diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2016-12-22 15:05:23 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-01-02 21:19:45 +0300 |
commit | 93d72ac3b68f3696ed5aa8d08ea044d7518d6699 (patch) | |
tree | 70c02765580cf5af481b48032e59c5d9b3bc6de8 /drivers/hwmon | |
parent | e57959a6d5d7c29f5273343024d936344f7a6a23 (diff) | |
download | linux-93d72ac3b68f3696ed5aa8d08ea044d7518d6699.tar.xz |
hwmon: (nct6775) 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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/nct6775.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index ce75dd4db7eb..2458b406f6aa 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c @@ -3127,14 +3127,14 @@ static const struct sensor_template_group nct6775_pwm_template_group = { }; static ssize_t -show_vid(struct device *dev, struct device_attribute *attr, char *buf) +cpu0_vid_show(struct device *dev, struct device_attribute *attr, char *buf) { struct nct6775_data *data = dev_get_drvdata(dev); return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); } -static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); +static DEVICE_ATTR_RO(cpu0_vid); /* Case open detection */ |