diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2018-12-10 17:02:15 -0500 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2019-02-18 17:23:29 -0500 |
| commit | 9d6c125575b47aa480e6d5a4ecebceff5bd79ae6 (patch) | |
| tree | 4c55f1aab6c425928020472510cf700798554daf /drivers/hwmon/max16065.c | |
| parent | decb23dc603691623a6312babcd9639543a92b17 (diff) | |
hwmon: (max16065) 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/max16065.c')
| -rw-r--r-- | drivers/hwmon/max16065.c | 225 |
1 files changed, 82 insertions, 143 deletions
diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c index 162401aaef71..1c372f76cd0b 100644 --- a/drivers/hwmon/max16065.c +++ b/drivers/hwmon/max16065.c | |||
| @@ -175,7 +175,7 @@ static struct max16065_data *max16065_update_device(struct device *dev) | |||
| 175 | return data; | 175 | return data; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | static ssize_t max16065_show_alarm(struct device *dev, | 178 | static ssize_t max16065_alarm_show(struct device *dev, |
| 179 | struct device_attribute *da, char *buf) | 179 | struct device_attribute *da, char *buf) |
| 180 | { | 180 | { |
| 181 | struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(da); | 181 | struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(da); |
| @@ -193,7 +193,7 @@ static ssize_t max16065_show_alarm(struct device *dev, | |||
| 193 | return snprintf(buf, PAGE_SIZE, "%d\n", !!val); | 193 | return snprintf(buf, PAGE_SIZE, "%d\n", !!val); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | static ssize_t max16065_show_input(struct device *dev, | 196 | static ssize_t max16065_input_show(struct device *dev, |
| 197 | struct device_attribute *da, char *buf) | 197 | struct device_attribute *da, char *buf) |
| 198 | { | 198 | { |
| 199 | struct sensor_device_attribute *attr = to_sensor_dev_attr(da); | 199 | struct sensor_device_attribute *attr = to_sensor_dev_attr(da); |
| @@ -207,7 +207,7 @@ static ssize_t max16065_show_input(struct device *dev, | |||
| 207 | ADC_TO_MV(adc, data->range[attr->index])); | 207 | ADC_TO_MV(adc, data->range[attr->index])); |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | static ssize_t max16065_show_current(struct device *dev, | 210 | static ssize_t max16065_current_show(struct device *dev, |
| 211 | struct device_attribute *da, char *buf) | 211 | struct device_attribute *da, char *buf) |
| 212 | { | 212 | { |
| 213 | struct max16065_data *data = max16065_update_device(dev); | 213 | struct max16065_data *data = max16065_update_device(dev); |
| @@ -219,9 +219,9 @@ static ssize_t max16065_show_current(struct device *dev, | |||
| 219 | ADC_TO_CURR(data->curr_sense, data->curr_gain)); | 219 | ADC_TO_CURR(data->curr_sense, data->curr_gain)); |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | static ssize_t max16065_set_limit(struct device *dev, | 222 | static ssize_t max16065_limit_store(struct device *dev, |
| 223 | struct device_attribute *da, | 223 | struct device_attribute *da, |
| 224 | const char *buf, size_t count) | 224 | const char *buf, size_t count) |
| 225 | { | 225 | { |
| 226 | struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(da); | 226 | struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(da); |
| 227 | struct max16065_data *data = dev_get_drvdata(dev); | 227 | struct max16065_data *data = dev_get_drvdata(dev); |
| @@ -246,7 +246,7 @@ static ssize_t max16065_set_limit(struct device *dev, | |||
| 246 | return count; | 246 | return count; |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | static ssize_t max16065_show_limit(struct device *dev, | 249 | static ssize_t max16065_limit_show(struct device *dev, |
| 250 | struct device_attribute *da, char *buf) | 250 | struct device_attribute *da, char *buf) |
| 251 | { | 251 | { |
| 252 | struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(da); | 252 | struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(da); |
| @@ -259,154 +259,93 @@ static ssize_t max16065_show_limit(struct device *dev, | |||
| 259 | /* Construct a sensor_device_attribute structure for each register */ | 259 | /* Construct a sensor_device_attribute structure for each register */ |
| 260 | 260 | ||
| 261 | /* Input voltages */ | 261 | /* Input voltages */ |
| 262 | static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, max16065_show_input, NULL, 0); | 262 | static SENSOR_DEVICE_ATTR_RO(in0_input, max16065_input, 0); |
| 263 | static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, max16065_show_input, NULL, 1); | 263 | static SENSOR_DEVICE_ATTR_RO(in1_input, max16065_input, 1); |
| 264 | static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, max16065_show_input, NULL, 2); | 264 | static SENSOR_DEVICE_ATTR_RO(in2_input, max16065_input, 2); |
| 265 | static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, max16065_show_input, NULL, 3); | 265 | static SENSOR_DEVICE_ATTR_RO(in3_input, max16065_input, 3); |
| 266 | static SENSOR_DEVICE_ATTR(in4_input, S_IRUGO, max16065_show_input, NULL, 4); | 266 | static SENSOR_DEVICE_ATTR_RO(in4_input, max16065_input, 4); |
| 267 | static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, max16065_show_input, NULL, 5); | 267 | static SENSOR_DEVICE_ATTR_RO(in5_input, max16065_input, 5); |
| 268 | static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, max16065_show_input, NULL, 6); | 268 | static SENSOR_DEVICE_ATTR_RO(in6_input, max16065_input, 6); |
| 269 | static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, max16065_show_input, NULL, 7); | 269 | static SENSOR_DEVICE_ATTR_RO(in7_input, max16065_input, 7); |
| 270 | static SENSOR_DEVICE_ATTR(in8_input, S_IRUGO, max16065_show_input, NULL, 8); | 270 | static SENSOR_DEVICE_ATTR_RO(in8_input, max16065_input, 8); |
| 271 | static SENSOR_DEVICE_ATTR(in9_input, S_IRUGO, max16065_show_input, NULL, 9); | 271 | static SENSOR_DEVICE_ATTR_RO(in9_input, max16065_input, 9); |
| 272 | static SENSOR_DEVICE_ATTR(in10_input, S_IRUGO, max16065_show_input, NULL, 10); | 272 | static SENSOR_DEVICE_ATTR_RO(in10_input, max16065_input, 10); |
| 273 | static SENSOR_DEVICE_ATTR(in11_input, S_IRUGO, max16065_show_input, NULL, 11); | 273 | static SENSOR_DEVICE_ATTR_RO(in11_input, max16065_input, 11); |
| 274 | static SENSOR_DEVICE_ATTR(in12_input, S_IRUGO, max16065_show_input, NULL, 12); | 274 | static SENSOR_DEVICE_ATTR_RO(in12_input, max16065_input, 12); |
| 275 | 275 | ||
| 276 | /* Input voltages lcrit */ | 276 | /* Input voltages lcrit */ |
| 277 | static SENSOR_DEVICE_ATTR_2(in0_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | 277 | static SENSOR_DEVICE_ATTR_2_RW(in0_lcrit, max16065_limit, 2, 0); |
| 278 | max16065_set_limit, 2, 0); | 278 | static SENSOR_DEVICE_ATTR_2_RW(in1_lcrit, max16065_limit, 2, 1); |
| 279 | static SENSOR_DEVICE_ATTR_2(in1_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | 279 | static SENSOR_DEVICE_ATTR_2_RW(in2_lcrit, max16065_limit, 2, 2); |
| 280 | max16065_set_limit, 2, 1); | 280 | static SENSOR_DEVICE_ATTR_2_RW(in3_lcrit, max16065_limit, 2, 3); |
| 281 | static SENSOR_DEVICE_ATTR_2(in2_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | 281 | static SENSOR_DEVICE_ATTR_2_RW(in4_lcrit, max16065_limit, 2, 4); |
| 282 | max16065_set_limit, 2, 2); | 282 | static SENSOR_DEVICE_ATTR_2_RW(in5_lcrit, max16065_limit, 2, 5); |
| 283 | static SENSOR_DEVICE_ATTR_2(in3_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | 283 | static SENSOR_DEVICE_ATTR_2_RW(in6_lcrit, max16065_limit, 2, 6); |
| 284 | max16065_set_limit, 2, 3); | 284 | static SENSOR_DEVICE_ATTR_2_RW(in7_lcrit, max16065_limit, 2, 7); |
| 285 | static SENSOR_DEVICE_ATTR_2(in4_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | 285 | static SENSOR_DEVICE_ATTR_2_RW(in8_lcrit, max16065_limit, 2, 8); |
| 286 | max16065_set_limit, 2, 4); | 286 | static SENSOR_DEVICE_ATTR_2_RW(in9_lcrit, max16065_limit, 2, 9); |
| 287 | static SENSOR_DEVICE_ATTR_2(in5_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | 287 | static SENSOR_DEVICE_ATTR_2_RW(in10_lcrit, max16065_limit, 2, 10); |
| 288 | max16065_set_limit, 2, 5); | 288 | static SENSOR_DEVICE_ATTR_2_RW(in11_lcrit, max16065_limit, 2, 11); |
| 289 | static SENSOR_DEVICE_ATTR_2(in6_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 290 | max16065_set_limit, 2, 6); | ||
| 291 | static SENSOR_DEVICE_ATTR_2(in7_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 292 | max16065_set_limit, 2, 7); | ||
| 293 | static SENSOR_DEVICE_ATTR_2(in8_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 294 | max16065_set_limit, 2, 8); | ||
| 295 | static SENSOR_DEVICE_ATTR_2(in9_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 296 | max16065_set_limit, 2, 9); | ||
| 297 | static SENSOR_DEVICE_ATTR_2(in10_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 298 | max16065_set_limit, 2, 10); | ||
| 299 | static SENSOR_DEVICE_ATTR_2(in11_lcrit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 300 | max16065_set_limit, 2, 11); | ||
| 301 | 289 | ||
| 302 | /* Input voltages crit */ | 290 | /* Input voltages crit */ |
| 303 | static SENSOR_DEVICE_ATTR_2(in0_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | 291 | static SENSOR_DEVICE_ATTR_2_RW(in0_crit, max16065_limit, 1, 0); |
| 304 | max16065_set_limit, 1, 0); | 292 | static SENSOR_DEVICE_ATTR_2_RW(in1_crit, max16065_limit, 1, 1); |
| 305 | static SENSOR_DEVICE_ATTR_2(in1_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | 293 | static SENSOR_DEVICE_ATTR_2_RW(in2_crit, max16065_limit, 1, 2); |
| 306 | max16065_set_limit, 1, 1); | 294 | static SENSOR_DEVICE_ATTR_2_RW(in3_crit, max16065_limit, 1, 3); |
| 307 | static SENSOR_DEVICE_ATTR_2(in2_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | 295 | static SENSOR_DEVICE_ATTR_2_RW(in4_crit, max16065_limit, 1, 4); |
| 308 | max16065_set_limit, 1, 2); | 296 | static SENSOR_DEVICE_ATTR_2_RW(in5_crit, max16065_limit, 1, 5); |
| 309 | static SENSOR_DEVICE_ATTR_2(in3_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | 297 | static SENSOR_DEVICE_ATTR_2_RW(in6_crit, max16065_limit, 1, 6); |
| 310 | max16065_set_limit, 1, 3); | 298 | static SENSOR_DEVICE_ATTR_2_RW(in7_crit, max16065_limit, 1, 7); |
| 311 | static SENSOR_DEVICE_ATTR_2(in4_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | 299 | static SENSOR_DEVICE_ATTR_2_RW(in8_crit, max16065_limit, 1, 8); |
| 312 | max16065_set_limit, 1, 4); | 300 | static SENSOR_DEVICE_ATTR_2_RW(in9_crit, max16065_limit, 1, 9); |
| 313 | static SENSOR_DEVICE_ATTR_2(in5_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | 301 | static SENSOR_DEVICE_ATTR_2_RW(in10_crit, max16065_limit, 1, 10); |
| 314 | max16065_set_limit, 1, 5); | 302 | static SENSOR_DEVICE_ATTR_2_RW(in11_crit, max16065_limit, 1, 11); |
| 315 | static SENSOR_DEVICE_ATTR_2(in6_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 316 | max16065_set_limit, 1, 6); | ||
| 317 | static SENSOR_DEVICE_ATTR_2(in7_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 318 | max16065_set_limit, 1, 7); | ||
| 319 | static SENSOR_DEVICE_ATTR_2(in8_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 320 | max16065_set_limit, 1, 8); | ||
| 321 | static SENSOR_DEVICE_ATTR_2(in9_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 322 | max16065_set_limit, 1, 9); | ||
| 323 | static SENSOR_DEVICE_ATTR_2(in10_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 324 | max16065_set_limit, 1, 10); | ||
| 325 | static SENSOR_DEVICE_ATTR_2(in11_crit, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 326 | max16065_set_limit, 1, 11); | ||
| 327 | 303 | ||
| 328 | /* Input voltages min */ | 304 | /* Input voltages min */ |
| 329 | static SENSOR_DEVICE_ATTR_2(in0_min, S_IWUSR | S_IRUGO, max16065_show_limit, | 305 | static SENSOR_DEVICE_ATTR_2_RW(in0_min, max16065_limit, 0, 0); |
| 330 | max16065_set_limit, 0, 0); | 306 | static SENSOR_DEVICE_ATTR_2_RW(in1_min, max16065_limit, 0, 1); |
| 331 | static SENSOR_DEVICE_ATTR_2(in1_min, S_IWUSR | S_IRUGO, max16065_show_limit, | 307 | static SENSOR_DEVICE_ATTR_2_RW(in2_min, max16065_limit, 0, 2); |
| 332 | max16065_set_limit, 0, 1); | 308 | static SENSOR_DEVICE_ATTR_2_RW(in3_min, max16065_limit, 0, 3); |
| 333 | static SENSOR_DEVICE_ATTR_2(in2_min, S_IWUSR | S_IRUGO, max16065_show_limit, | 309 | static SENSOR_DEVICE_ATTR_2_RW(in4_min, max16065_limit, 0, 4); |
| 334 | max16065_set_limit, 0, 2); | 310 | static SENSOR_DEVICE_ATTR_2_RW(in5_min, max16065_limit, 0, 5); |
| 335 | static SENSOR_DEVICE_ATTR_2(in3_min, S_IWUSR | S_IRUGO, max16065_show_limit, | 311 | static SENSOR_DEVICE_ATTR_2_RW(in6_min, max16065_limit, 0, 6); |
| 336 | max16065_set_limit, 0, 3); | 312 | static SENSOR_DEVICE_ATTR_2_RW(in7_min, max16065_limit, 0, 7); |
| 337 | static SENSOR_DEVICE_ATTR_2(in4_min, S_IWUSR | S_IRUGO, max16065_show_limit, | 313 | static SENSOR_DEVICE_ATTR_2_RW(in8_min, max16065_limit, 0, 8); |
| 338 | max16065_set_limit, 0, 4); | 314 | static SENSOR_DEVICE_ATTR_2_RW(in9_min, max16065_limit, 0, 9); |
| 339 | static SENSOR_DEVICE_ATTR_2(in5_min, S_IWUSR | S_IRUGO, max16065_show_limit, | 315 | static SENSOR_DEVICE_ATTR_2_RW(in10_min, max16065_limit, 0, 10); |
| 340 | max16065_set_limit, 0, 5); | 316 | static SENSOR_DEVICE_ATTR_2_RW(in11_min, max16065_limit, 0, 11); |
| 341 | static SENSOR_DEVICE_ATTR_2(in6_min, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 342 | max16065_set_limit, 0, 6); | ||
| 343 | static SENSOR_DEVICE_ATTR_2(in7_min, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 344 | max16065_set_limit, 0, 7); | ||
| 345 | static SENSOR_DEVICE_ATTR_2(in8_min, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 346 | max16065_set_limit, 0, 8); | ||
| 347 | static SENSOR_DEVICE_ATTR_2(in9_min, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 348 | max16065_set_limit, 0, 9); | ||
| 349 | static SENSOR_DEVICE_ATTR_2(in10_min, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 350 | max16065_set_limit, 0, 10); | ||
| 351 | static SENSOR_DEVICE_ATTR_2(in11_min, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 352 | max16065_set_limit, 0, 11); | ||
| 353 | 317 | ||
| 354 | /* Input voltages max */ | 318 | /* Input voltages max */ |
| 355 | static SENSOR_DEVICE_ATTR_2(in0_max, S_IWUSR | S_IRUGO, max16065_show_limit, | 319 | static SENSOR_DEVICE_ATTR_2_RW(in0_max, max16065_limit, 0, 0); |
| 356 | max16065_set_limit, 0, 0); | 320 | static SENSOR_DEVICE_ATTR_2_RW(in1_max, max16065_limit, 0, 1); |
| 357 | static SENSOR_DEVICE_ATTR_2(in1_max, S_IWUSR | S_IRUGO, max16065_show_limit, | 321 | static SENSOR_DEVICE_ATTR_2_RW(in2_max, max16065_limit, 0, 2); |
| 358 | max16065_set_limit, 0, 1); | 322 | static SENSOR_DEVICE_ATTR_2_RW(in3_max, max16065_limit, 0, 3); |
| 359 | static SENSOR_DEVICE_ATTR_2(in2_max, S_IWUSR | S_IRUGO, max16065_show_limit, | 323 | static SENSOR_DEVICE_ATTR_2_RW(in4_max, max16065_limit, 0, 4); |
| 360 | max16065_set_limit, 0, 2); | 324 | static SENSOR_DEVICE_ATTR_2_RW(in5_max, max16065_limit, 0, 5); |
| 361 | static SENSOR_DEVICE_ATTR_2(in3_max, S_IWUSR | S_IRUGO, max16065_show_limit, | 325 | static SENSOR_DEVICE_ATTR_2_RW(in6_max, max16065_limit, 0, 6); |
| 362 | max16065_set_limit, 0, 3); | 326 | static SENSOR_DEVICE_ATTR_2_RW(in7_max, max16065_limit, 0, 7); |
| 363 | static SENSOR_DEVICE_ATTR_2(in4_max, S_IWUSR | S_IRUGO, max16065_show_limit, | 327 | static SENSOR_DEVICE_ATTR_2_RW(in8_max, max16065_limit, 0, 8); |
| 364 | max16065_set_limit, 0, 4); | 328 | static SENSOR_DEVICE_ATTR_2_RW(in9_max, max16065_limit, 0, 9); |
| 365 | static SENSOR_DEVICE_ATTR_2(in5_max, S_IWUSR | S_IRUGO, max16065_show_limit, | 329 | static SENSOR_DEVICE_ATTR_2_RW(in10_max, max16065_limit, 0, 10); |
| 366 | max16065_set_limit, 0, 5); | 330 | static SENSOR_DEVICE_ATTR_2_RW(in11_max, max16065_limit, 0, 11); |
| 367 | static SENSOR_DEVICE_ATTR_2(in6_max, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 368 | max16065_set_limit, 0, 6); | ||
| 369 | static SENSOR_DEVICE_ATTR_2(in7_max, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 370 | max16065_set_limit, 0, 7); | ||
| 371 | static SENSOR_DEVICE_ATTR_2(in8_max, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 372 | max16065_set_limit, 0, 8); | ||
| 373 | static SENSOR_DEVICE_ATTR_2(in9_max, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 374 | max16065_set_limit, 0, 9); | ||
| 375 | static SENSOR_DEVICE_ATTR_2(in10_max, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 376 | max16065_set_limit, 0, 10); | ||
| 377 | static SENSOR_DEVICE_ATTR_2(in11_max, S_IWUSR | S_IRUGO, max16065_show_limit, | ||
| 378 | max16065_set_limit, 0, 11); | ||
| 379 | 331 | ||
| 380 | /* alarms */ | 332 | /* alarms */ |
| 381 | static SENSOR_DEVICE_ATTR_2(in0_alarm, S_IRUGO, max16065_show_alarm, NULL, | 333 | static SENSOR_DEVICE_ATTR_2_RO(in0_alarm, max16065_alarm, 0, 0); |
| 382 | 0, 0); | 334 | static SENSOR_DEVICE_ATTR_2_RO(in1_alarm, max16065_alarm, 0, 1); |
| 383 | static SENSOR_DEVICE_ATTR_2(in1_alarm, S_IRUGO, max16065_show_alarm, NULL, | 335 | static SENSOR_DEVICE_ATTR_2_RO(in2_alarm, max16065_alarm, 0, 2); |
| 384 | 0, 1); | 336 | static SENSOR_DEVICE_ATTR_2_RO(in3_alarm, max16065_alarm, 0, 3); |
| 385 | static SENSOR_DEVICE_ATTR_2(in2_alarm, S_IRUGO, max16065_show_alarm, NULL, | 337 | static SENSOR_DEVICE_ATTR_2_RO(in4_alarm, max16065_alarm, 0, 4); |
| 386 | 0, 2); | 338 | static SENSOR_DEVICE_ATTR_2_RO(in5_alarm, max16065_alarm, 0, 5); |
| 387 | static SENSOR_DEVICE_ATTR_2(in3_alarm, S_IRUGO, max16065_show_alarm, NULL, | 339 | static SENSOR_DEVICE_ATTR_2_RO(in6_alarm, max16065_alarm, 0, 6); |
| 388 | 0, 3); | 340 | static SENSOR_DEVICE_ATTR_2_RO(in7_alarm, max16065_alarm, 0, 7); |
| 389 | static SENSOR_DEVICE_ATTR_2(in4_alarm, S_IRUGO, max16065_show_alarm, NULL, | 341 | static SENSOR_DEVICE_ATTR_2_RO(in8_alarm, max16065_alarm, 1, 0); |
| 390 | 0, 4); | 342 | static SENSOR_DEVICE_ATTR_2_RO(in9_alarm, max16065_alarm, 1, 1); |
| 391 | static SENSOR_DEVICE_ATTR_2(in5_alarm, S_IRUGO, max16065_show_alarm, NULL, | 343 | static SENSOR_DEVICE_ATTR_2_RO(in10_alarm, max16065_alarm, 1, 2); |
| 392 | 0, 5); | 344 | static SENSOR_DEVICE_ATTR_2_RO(in11_alarm, max16065_alarm, 1, 3); |
| 393 | static SENSOR_DEVICE_ATTR_2(in6_alarm, S_IRUGO, max16065_show_alarm, NULL, | ||
| 394 | 0, 6); | ||
| 395 | static SENSOR_DEVICE_ATTR_2(in7_alarm, S_IRUGO, max16065_show_alarm, NULL, | ||
| 396 | 0, 7); | ||
| 397 | static SENSOR_DEVICE_ATTR_2(in8_alarm, S_IRUGO, max16065_show_alarm, NULL, | ||
| 398 | 1, 0); | ||
| 399 | static SENSOR_DEVICE_ATTR_2(in9_alarm, S_IRUGO, max16065_show_alarm, NULL, | ||
| 400 | 1, 1); | ||
| 401 | static SENSOR_DEVICE_ATTR_2(in10_alarm, S_IRUGO, max16065_show_alarm, NULL, | ||
| 402 | 1, 2); | ||
| 403 | static SENSOR_DEVICE_ATTR_2(in11_alarm, S_IRUGO, max16065_show_alarm, NULL, | ||
| 404 | 1, 3); | ||
| 405 | 345 | ||
| 406 | /* Current and alarm */ | 346 | /* Current and alarm */ |
| 407 | static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, max16065_show_current, NULL, 0); | 347 | static SENSOR_DEVICE_ATTR_RO(curr1_input, max16065_current, 0); |
| 408 | static SENSOR_DEVICE_ATTR_2(curr1_alarm, S_IRUGO, max16065_show_alarm, NULL, | 348 | static SENSOR_DEVICE_ATTR_2_RO(curr1_alarm, max16065_alarm, 1, 4); |
| 409 | 1, 4); | ||
| 410 | 349 | ||
| 411 | /* | 350 | /* |
| 412 | * Finally, construct an array of pointers to members of the above objects, | 351 | * Finally, construct an array of pointers to members of the above objects, |
