summaryrefslogtreecommitdiffstats
path: root/drivers/misc/eeprom
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-12-21 15:48:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-24 09:36:02 +0100
commit052bd11eb8e5db0484a6e545ca78bf0f3f16904e (patch)
tree4c4193f3fa26db98b7de6d3d28095d5500b7813f /drivers/misc/eeprom
parentmisc: eeprom/idt_89hpesx: Constify 'struct bin_attribute' (diff)
downloadlinux-052bd11eb8e5db0484a6e545ca78bf0f3f16904e.tar.xz
linux-052bd11eb8e5db0484a6e545ca78bf0f3f16904e.zip
misc: eeprom/max6875: Constify 'struct bin_attribute'
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241221-sysfs-const-bin_attr-misc-drivers-v2-8-ba5e79fe8771@weissschuh.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/eeprom')
-rw-r--r--drivers/misc/eeprom/max6875.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c
index 6fab2ffa736b..1c36ad153e78 100644
--- a/drivers/misc/eeprom/max6875.c
+++ b/drivers/misc/eeprom/max6875.c
@@ -104,7 +104,7 @@ exit_up:
}
static ssize_t max6875_read(struct file *filp, struct kobject *kobj,
- struct bin_attribute *bin_attr,
+ const struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
struct i2c_client *client = kobj_to_i2c_client(kobj);
@@ -127,7 +127,7 @@ static const struct bin_attribute user_eeprom_attr = {
.mode = S_IRUGO,
},
.size = USER_EEPROM_SIZE,
- .read = max6875_read,
+ .read_new = max6875_read,
};
static int max6875_probe(struct i2c_client *client)