summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2018-12-10 17:02:00 -0500
committerGuenter Roeck <linux@roeck-us.net>2018-12-16 18:13:35 -0500
commit7e77d1e76d36a231498d17265a1dae9dd337d397 (patch)
treeca75457ae625041ae1c1e58a63036971a55d975f
parentcfc5bca6db53eb9ddc062a89993a29731d96c619 (diff)
hwmon: (ads1015) Use permission specific SENSOR[_DEVICE]_ATTR variants
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, 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. Cc: Dirk Eibach <eibach@gdsys.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/ads1015.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
index 98c704d3366a..c21b0529adb2 100644
--- a/drivers/hwmon/ads1015.c
+++ b/drivers/hwmon/ads1015.c
@@ -133,8 +133,8 @@ static int ads1015_reg_to_mv(struct i2c_client *client, unsigned int channel,
133} 133}
134 134
135/* sysfs callback function */ 135/* sysfs callback function */
136static ssize_t show_in(struct device *dev, struct device_attribute *da, 136static ssize_t in_show(struct device *dev, struct device_attribute *da,
137 char *buf) 137 char *buf)
138{ 138{
139 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); 139 struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
140 struct i2c_client *client = to_i2c_client(dev); 140 struct i2c_client *client = to_i2c_client(dev);
@@ -149,14 +149,14 @@ static ssize_t show_in(struct device *dev, struct device_attribute *da,
149} 149}
150 150
151static const struct sensor_device_attribute ads1015_in[] = { 151static const struct sensor_device_attribute ads1015_in[] = {
152 SENSOR_ATTR(in0_input, S_IRUGO, show_in, NULL, 0), 152 SENSOR_ATTR_RO(in0_input, in, 0),
153 SENSOR_ATTR(in1_input, S_IRUGO, show_in, NULL, 1), 153 SENSOR_ATTR_RO(in1_input, in, 1),
154 SENSOR_ATTR(in2_input, S_IRUGO, show_in, NULL, 2), 154 SENSOR_ATTR_RO(in2_input, in, 2),
155 SENSOR_ATTR(in3_input, S_IRUGO, show_in, NULL, 3), 155 SENSOR_ATTR_RO(in3_input, in, 3),
156 SENSOR_ATTR(in4_input, S_IRUGO, show_in, NULL, 4), 156 SENSOR_ATTR_RO(in4_input, in, 4),
157 SENSOR_ATTR(in5_input, S_IRUGO, show_in, NULL, 5), 157 SENSOR_ATTR_RO(in5_input, in, 5),
158 SENSOR_ATTR(in6_input, S_IRUGO, show_in, NULL, 6), 158 SENSOR_ATTR_RO(in6_input, in, 6),
159 SENSOR_ATTR(in7_input, S_IRUGO, show_in, NULL, 7), 159 SENSOR_ATTR_RO(in7_input, in, 7),
160}; 160};
161 161
162/* 162/*