diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2016-12-22 13:04:57 +0100 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-01-02 19:19:45 +0100 |
commit | 23eb359dd62224d971d0c70d11f57822560ce323 (patch) | |
tree | 3d2379972bb67fc4e2dd74860bf0fef65ff1be5a /drivers | |
parent | hwmon: (max1111) use permission-specific DEVICE_ATTR variants (diff) | |
download | linux-23eb359dd62224d971d0c70d11f57822560ce323.tar.xz linux-23eb359dd62224d971d0c70d11f57822560ce323.zip |
hwmon: (max1619) use permission-specific DEVICE_ATTR variants
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source
code, improves readbility, and reduces the chance of inconsistencies.
The conversion was done automatically using coccinelle. It was validated
by compiling both the old and the new source code and comparing its text,
data, and bss size.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
[groeck: Updated description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/max1619.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index eda9cf599685..a18278938494 100644 --- a/drivers/hwmon/max1619.c +++ b/drivers/hwmon/max1619.c @@ -173,7 +173,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr, return count; } -static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, +static ssize_t alarms_show(struct device *dev, struct device_attribute *attr, char *buf) { struct max1619_data *data = max1619_update_device(dev); @@ -199,7 +199,7 @@ static SENSOR_DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_temp, set_temp, static SENSOR_DEVICE_ATTR(temp2_crit_hyst, S_IWUSR | S_IRUGO, show_temp, set_temp, t_hyst2); -static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); +static DEVICE_ATTR_RO(alarms); static SENSOR_DEVICE_ATTR(temp2_crit_alarm, S_IRUGO, show_alarm, NULL, 1); static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_alarm, NULL, 2); static SENSOR_DEVICE_ATTR(temp2_min_alarm, S_IRUGO, show_alarm, NULL, 3); |