summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2016-12-22 07:04:40 -0500
committerGuenter Roeck <linux@roeck-us.net>2017-01-02 13:19:45 -0500
commite34e885b9e32d7c78dd4d4f60616f1026ae0061e (patch)
tree59c6e73c5359db384e537099d60bc916b7d37c01
parentf2620e7fa3be6c582ca64f0941987b0b86e974de (diff)
hwmon: (fschmd) use permission-specific DEVICE_ATTR variants
Use DEVICE_ATTR_RW for read/write 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>
-rw-r--r--drivers/hwmon/fschmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index d58abdc5a4cf..5e78229ade04 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -561,7 +561,7 @@ static ssize_t store_pwm_auto_point1_pwm(struct device *dev,
561 * The FSC hwmon family has the ability to force an attached alert led to flash 561 * The FSC hwmon family has the ability to force an attached alert led to flash
562 * from software, we export this as an alert_led sysfs attr 562 * from software, we export this as an alert_led sysfs attr
563 */ 563 */
564static ssize_t show_alert_led(struct device *dev, 564static ssize_t alert_led_show(struct device *dev,
565 struct device_attribute *devattr, char *buf) 565 struct device_attribute *devattr, char *buf)
566{ 566{
567 struct fschmd_data *data = fschmd_update_device(dev); 567 struct fschmd_data *data = fschmd_update_device(dev);
@@ -572,7 +572,7 @@ static ssize_t show_alert_led(struct device *dev,
572 return sprintf(buf, "0\n"); 572 return sprintf(buf, "0\n");
573} 573}
574 574
575static ssize_t store_alert_led(struct device *dev, 575static ssize_t alert_led_store(struct device *dev,
576 struct device_attribute *devattr, const char *buf, size_t count) 576 struct device_attribute *devattr, const char *buf, size_t count)
577{ 577{
578 u8 reg; 578 u8 reg;
@@ -602,7 +602,7 @@ static ssize_t store_alert_led(struct device *dev,
602 return count; 602 return count;
603} 603}
604 604
605static DEVICE_ATTR(alert_led, 0644, show_alert_led, store_alert_led); 605static DEVICE_ATTR_RW(alert_led);
606 606
607static struct sensor_device_attribute fschmd_attr[] = { 607static struct sensor_device_attribute fschmd_attr[] = {
608 SENSOR_ATTR(in0_input, 0444, show_in_value, NULL, 0), 608 SENSOR_ATTR(in0_input, 0444, show_in_value, NULL, 0),