Skip to content

Commit 7543d57

Browse files
t-8chTzung-Bi Shih
authored andcommitted
firmware: google: vpd: Use const 'struct bin_attribute' callback
The sysfs core now provides callback variants that explicitly take a const pointer. Use them so the non-const variants can be removed. Signed-off-by: Thomas Weißschuh <[email protected]> Acked-by: Brian Norris <[email protected]> Link: https://lore.kernel.org/r/20241215-sysfs-const-bin_attr-google-v1-4-e5c2808f5833@weissschuh.net Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 093d752 commit 7543d57

File tree

1 file changed

+4
-4
lines changed
  • drivers/firmware/google

1 file changed

+4
-4
lines changed

drivers/firmware/google/vpd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static struct vpd_section ro_vpd;
5656
static struct vpd_section rw_vpd;
5757

5858
static ssize_t vpd_attrib_read(struct file *filp, struct kobject *kobp,
59-
struct bin_attribute *bin_attr, char *buf,
59+
const struct bin_attribute *bin_attr, char *buf,
6060
loff_t pos, size_t count)
6161
{
6262
struct vpd_attrib_info *info = bin_attr->private;
@@ -121,7 +121,7 @@ static int vpd_section_attrib_add(const u8 *key, u32 key_len,
121121
info->bin_attr.attr.name = info->key;
122122
info->bin_attr.attr.mode = 0444;
123123
info->bin_attr.size = value_len;
124-
info->bin_attr.read = vpd_attrib_read;
124+
info->bin_attr.read_new = vpd_attrib_read;
125125
info->bin_attr.private = info;
126126

127127
info->value = value;
@@ -156,7 +156,7 @@ static void vpd_section_attrib_destroy(struct vpd_section *sec)
156156
}
157157

158158
static ssize_t vpd_section_read(struct file *filp, struct kobject *kobp,
159-
struct bin_attribute *bin_attr, char *buf,
159+
const struct bin_attribute *bin_attr, char *buf,
160160
loff_t pos, size_t count)
161161
{
162162
struct vpd_section *sec = bin_attr->private;
@@ -201,7 +201,7 @@ static int vpd_section_init(const char *name, struct vpd_section *sec,
201201
sec->bin_attr.attr.name = sec->raw_name;
202202
sec->bin_attr.attr.mode = 0444;
203203
sec->bin_attr.size = size;
204-
sec->bin_attr.read = vpd_section_read;
204+
sec->bin_attr.read_new = vpd_section_read;
205205
sec->bin_attr.private = sec;
206206

207207
err = sysfs_create_bin_file(vpd_kobj, &sec->bin_attr);

0 commit comments

Comments
 (0)