aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2018-12-10 17:02:16 -0500
committerGuenter Roeck <linux@roeck-us.net>2019-02-18 17:23:29 -0500
commit845ee70923e1b2c698dc5772836d690538df8062 (patch)
tree7718e5eafd283ed3f4faacd1b735c90c8d7dd21a /drivers/hwmon
parent21887303b761c5f9234b8a37ab9d4f3beb3dcb36 (diff)
hwmon: (max31722) Use permission specific SENSOR[_DEVICE]_ATTR variants
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readability, and to reduce the chance of inconsistencies. Also replace any remaining S_<PERMS> in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/max31722.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/hwmon/max31722.c b/drivers/hwmon/max31722.c
index 30a100e70a0d..6d169b4271f7 100644
--- a/drivers/hwmon/max31722.c
+++ b/drivers/hwmon/max31722.c
@@ -50,9 +50,8 @@ static int max31722_set_mode(struct max31722_data *data, u8 mode)
50 return 0; 50 return 0;
51} 51}
52 52
53static ssize_t max31722_show_temp(struct device *dev, 53static ssize_t max31722_temp_show(struct device *dev,
54 struct device_attribute *attr, 54 struct device_attribute *attr, char *buf)
55 char *buf)
56{ 55{
57 ssize_t ret; 56 ssize_t ret;
58 struct max31722_data *data = dev_get_drvdata(dev); 57 struct max31722_data *data = dev_get_drvdata(dev);
@@ -64,8 +63,7 @@ static ssize_t max31722_show_temp(struct device *dev,
64 return sprintf(buf, "%d\n", (s16)le16_to_cpu(ret) * 125 / 32); 63 return sprintf(buf, "%d\n", (s16)le16_to_cpu(ret) * 125 / 32);
65} 64}
66 65
67static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, 66static SENSOR_DEVICE_ATTR_RO(temp1_input, max31722_temp, 0);
68 max31722_show_temp, NULL, 0);
69 67
70static struct attribute *max31722_attrs[] = { 68static struct attribute *max31722_attrs[] = {
71 &sensor_dev_attr_temp1_input.dev_attr.attr, 69 &sensor_dev_attr_temp1_input.dev_attr.attr,