diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2016-12-22 13:05:22 +0100 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-01-02 10:19:45 -0800 |
commit | e57959a6d5d7c29f5273343024d936344f7a6a23 (patch) | |
tree | a1929468a74c491d1843c0c85c213e1da959eb3e /drivers | |
parent | ddc64ae839500fd7db791af0d7c92323305a3d42 (diff) |
hwmon: (lm90) 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')
-rw-r--r-- | drivers/hwmon/lm90.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 841f2428e84a..aff5297bc2bc 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -830,7 +830,7 @@ static u16 temp_to_u16_adt7461(struct lm90_data *data, long val) } /* pec used for ADM1032 only */ -static ssize_t show_pec(struct device *dev, struct device_attribute *dummy, +static ssize_t pec_show(struct device *dev, struct device_attribute *dummy, char *buf) { struct i2c_client *client = to_i2c_client(dev); @@ -838,8 +838,8 @@ static ssize_t show_pec(struct device *dev, struct device_attribute *dummy, return sprintf(buf, "%d\n", !!(client->flags & I2C_CLIENT_PEC)); } -static ssize_t set_pec(struct device *dev, struct device_attribute *dummy, - const char *buf, size_t count) +static ssize_t pec_store(struct device *dev, struct device_attribute *dummy, + const char *buf, size_t count) { struct i2c_client *client = to_i2c_client(dev); long val; @@ -863,7 +863,7 @@ static ssize_t set_pec(struct device *dev, struct device_attribute *dummy, return count; } -static DEVICE_ATTR(pec, S_IWUSR | S_IRUGO, show_pec, set_pec); +static DEVICE_ATTR_RW(pec); static int lm90_get_temp11(struct lm90_data *data, int index) { |