aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/lm78.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips/lm78.c')
-rw-r--r--drivers/i2c/chips/lm78.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
index 6d52d14eb31c..21b195ff3871 100644
--- a/drivers/i2c/chips/lm78.c
+++ b/drivers/i2c/chips/lm78.c
@@ -224,28 +224,28 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
224 224
225#define show_in_offset(offset) \ 225#define show_in_offset(offset) \
226static ssize_t \ 226static ssize_t \
227 show_in##offset (struct device *dev, char *buf) \ 227 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
228{ \ 228{ \
229 return show_in(dev, buf, offset); \ 229 return show_in(dev, buf, offset); \
230} \ 230} \
231static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 231static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
232 show_in##offset, NULL); \ 232 show_in##offset, NULL); \
233static ssize_t \ 233static ssize_t \
234 show_in##offset##_min (struct device *dev, char *buf) \ 234 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
235{ \ 235{ \
236 return show_in_min(dev, buf, offset); \ 236 return show_in_min(dev, buf, offset); \
237} \ 237} \
238static ssize_t \ 238static ssize_t \
239 show_in##offset##_max (struct device *dev, char *buf) \ 239 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
240{ \ 240{ \
241 return show_in_max(dev, buf, offset); \ 241 return show_in_max(dev, buf, offset); \
242} \ 242} \
243static ssize_t set_in##offset##_min (struct device *dev, \ 243static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
244 const char *buf, size_t count) \ 244 const char *buf, size_t count) \
245{ \ 245{ \
246 return set_in_min(dev, buf, count, offset); \ 246 return set_in_min(dev, buf, count, offset); \
247} \ 247} \
248static ssize_t set_in##offset##_max (struct device *dev, \ 248static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
249 const char *buf, size_t count) \ 249 const char *buf, size_t count) \
250{ \ 250{ \
251 return set_in_max(dev, buf, count, offset); \ 251 return set_in_max(dev, buf, count, offset); \
@@ -264,19 +264,19 @@ show_in_offset(5);
264show_in_offset(6); 264show_in_offset(6);
265 265
266/* Temperature */ 266/* Temperature */
267static ssize_t show_temp(struct device *dev, char *buf) 267static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
268{ 268{
269 struct lm78_data *data = lm78_update_device(dev); 269 struct lm78_data *data = lm78_update_device(dev);
270 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 270 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
271} 271}
272 272
273static ssize_t show_temp_over(struct device *dev, char *buf) 273static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
274{ 274{
275 struct lm78_data *data = lm78_update_device(dev); 275 struct lm78_data *data = lm78_update_device(dev);
276 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 276 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
277} 277}
278 278
279static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count) 279static ssize_t set_temp_over(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
280{ 280{
281 struct i2c_client *client = to_i2c_client(dev); 281 struct i2c_client *client = to_i2c_client(dev);
282 struct lm78_data *data = i2c_get_clientdata(client); 282 struct lm78_data *data = i2c_get_clientdata(client);
@@ -289,13 +289,13 @@ static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count)
289 return count; 289 return count;
290} 290}
291 291
292static ssize_t show_temp_hyst(struct device *dev, char *buf) 292static ssize_t show_temp_hyst(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct lm78_data *data = lm78_update_device(dev); 294 struct lm78_data *data = lm78_update_device(dev);
295 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst)); 295 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
296} 296}
297 297
298static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count) 298static ssize_t set_temp_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
299{ 299{
300 struct i2c_client *client = to_i2c_client(dev); 300 struct i2c_client *client = to_i2c_client(dev);
301 struct lm78_data *data = i2c_get_clientdata(client); 301 struct lm78_data *data = i2c_get_clientdata(client);
@@ -398,19 +398,19 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
398} 398}
399 399
400#define show_fan_offset(offset) \ 400#define show_fan_offset(offset) \
401static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 401static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
402{ \ 402{ \
403 return show_fan(dev, buf, offset - 1); \ 403 return show_fan(dev, buf, offset - 1); \
404} \ 404} \
405static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 405static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
406{ \ 406{ \
407 return show_fan_min(dev, buf, offset - 1); \ 407 return show_fan_min(dev, buf, offset - 1); \
408} \ 408} \
409static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 409static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
410{ \ 410{ \
411 return show_fan_div(dev, buf, offset - 1); \ 411 return show_fan_div(dev, buf, offset - 1); \
412} \ 412} \
413static ssize_t set_fan_##offset##_min (struct device *dev, \ 413static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
414 const char *buf, size_t count) \ 414 const char *buf, size_t count) \
415{ \ 415{ \
416 return set_fan_min(dev, buf, count, offset - 1); \ 416 return set_fan_min(dev, buf, count, offset - 1); \
@@ -419,13 +419,13 @@ static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
419static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ 419static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
420 show_fan_##offset##_min, set_fan_##offset##_min); 420 show_fan_##offset##_min, set_fan_##offset##_min);
421 421
422static ssize_t set_fan_1_div(struct device *dev, const char *buf, 422static ssize_t set_fan_1_div(struct device *dev, struct device_attribute *attr, const char *buf,
423 size_t count) 423 size_t count)
424{ 424{
425 return set_fan_div(dev, buf, count, 0) ; 425 return set_fan_div(dev, buf, count, 0) ;
426} 426}
427 427
428static ssize_t set_fan_2_div(struct device *dev, const char *buf, 428static ssize_t set_fan_2_div(struct device *dev, struct device_attribute *attr, const char *buf,
429 size_t count) 429 size_t count)
430{ 430{
431 return set_fan_div(dev, buf, count, 1) ; 431 return set_fan_div(dev, buf, count, 1) ;
@@ -443,7 +443,7 @@ static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
443static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); 443static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL);
444 444
445/* VID */ 445/* VID */
446static ssize_t show_vid(struct device *dev, char *buf) 446static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
447{ 447{
448 struct lm78_data *data = lm78_update_device(dev); 448 struct lm78_data *data = lm78_update_device(dev);
449 return sprintf(buf, "%d\n", VID_FROM_REG(data->vid)); 449 return sprintf(buf, "%d\n", VID_FROM_REG(data->vid));
@@ -451,7 +451,7 @@ static ssize_t show_vid(struct device *dev, char *buf)
451static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 451static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
452 452
453/* Alarms */ 453/* Alarms */
454static ssize_t show_alarms(struct device *dev, char *buf) 454static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
455{ 455{
456 struct lm78_data *data = lm78_update_device(dev); 456 struct lm78_data *data = lm78_update_device(dev);
457 return sprintf(buf, "%u\n", data->alarms); 457 return sprintf(buf, "%u\n", data->alarms);