aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/lm87.c
diff options
context:
space:
mode:
authorYani Ioannou <yani.ioannou@gmail.com>2005-05-17 06:42:03 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:33 -0400
commit8627f9ba531269d8850919c62af1b017438e2e79 (patch)
treeed560594954e5e2303c98bbc8fb83ec7e0dec661 /drivers/i2c/chips/lm87.c
parent30f74292e50d6c4ae438dbee5cb45d77bf774351 (diff)
[PATCH] Driver Core: drivers/i2c/chips/lm77.c - max1619.c: update device attribute callbacks
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips/lm87.c')
-rw-r--r--drivers/i2c/chips/lm87.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/i2c/chips/lm87.c b/drivers/i2c/chips/lm87.c
index 98cabd665063..4372b61a0882 100644
--- a/drivers/i2c/chips/lm87.c
+++ b/drivers/i2c/chips/lm87.c
@@ -218,19 +218,19 @@ static inline int lm87_write_value(struct i2c_client *client, u8 reg, u8 value)
218} 218}
219 219
220#define show_in(offset) \ 220#define show_in(offset) \
221static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ 221static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
222{ \ 222{ \
223 struct lm87_data *data = lm87_update_device(dev); \ 223 struct lm87_data *data = lm87_update_device(dev); \
224 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 224 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
225 data->in_scale[offset])); \ 225 data->in_scale[offset])); \
226} \ 226} \
227static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 227static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
228{ \ 228{ \
229 struct lm87_data *data = lm87_update_device(dev); \ 229 struct lm87_data *data = lm87_update_device(dev); \
230 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 230 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
231 data->in_scale[offset])); \ 231 data->in_scale[offset])); \
232} \ 232} \
233static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 233static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
234{ \ 234{ \
235 struct lm87_data *data = lm87_update_device(dev); \ 235 struct lm87_data *data = lm87_update_device(dev); \
236 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 236 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
@@ -274,13 +274,13 @@ static void set_in_max(struct device *dev, const char *buf, int nr)
274} 274}
275 275
276#define set_in(offset) \ 276#define set_in(offset) \
277static ssize_t set_in##offset##_min(struct device *dev, \ 277static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, \
278 const char *buf, size_t count) \ 278 const char *buf, size_t count) \
279{ \ 279{ \
280 set_in_min(dev, buf, offset); \ 280 set_in_min(dev, buf, offset); \
281 return count; \ 281 return count; \
282} \ 282} \
283static ssize_t set_in##offset##_max(struct device *dev, \ 283static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, \
284 const char *buf, size_t count) \ 284 const char *buf, size_t count) \
285{ \ 285{ \
286 set_in_max(dev, buf, offset); \ 286 set_in_max(dev, buf, offset); \
@@ -300,17 +300,17 @@ set_in(6);
300set_in(7); 300set_in(7);
301 301
302#define show_temp(offset) \ 302#define show_temp(offset) \
303static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 303static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
304{ \ 304{ \
305 struct lm87_data *data = lm87_update_device(dev); \ 305 struct lm87_data *data = lm87_update_device(dev); \
306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
307} \ 307} \
308static ssize_t show_temp##offset##_low(struct device *dev, char *buf) \ 308static ssize_t show_temp##offset##_low(struct device *dev, struct device_attribute *attr, char *buf) \
309{ \ 309{ \
310 struct lm87_data *data = lm87_update_device(dev); \ 310 struct lm87_data *data = lm87_update_device(dev); \
311 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \ 311 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \
312} \ 312} \
313static ssize_t show_temp##offset##_high(struct device *dev, char *buf) \ 313static ssize_t show_temp##offset##_high(struct device *dev, struct device_attribute *attr, char *buf) \
314{ \ 314{ \
315 struct lm87_data *data = lm87_update_device(dev); \ 315 struct lm87_data *data = lm87_update_device(dev); \
316 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \ 316 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \
@@ -346,13 +346,13 @@ static void set_temp_high(struct device *dev, const char *buf, int nr)
346} 346}
347 347
348#define set_temp(offset) \ 348#define set_temp(offset) \
349static ssize_t set_temp##offset##_low(struct device *dev, \ 349static ssize_t set_temp##offset##_low(struct device *dev, struct device_attribute *attr, \
350 const char *buf, size_t count) \ 350 const char *buf, size_t count) \
351{ \ 351{ \
352 set_temp_low(dev, buf, offset-1); \ 352 set_temp_low(dev, buf, offset-1); \
353 return count; \ 353 return count; \
354} \ 354} \
355static ssize_t set_temp##offset##_high(struct device *dev, \ 355static ssize_t set_temp##offset##_high(struct device *dev, struct device_attribute *attr, \
356 const char *buf, size_t count) \ 356 const char *buf, size_t count) \
357{ \ 357{ \
358 set_temp_high(dev, buf, offset-1); \ 358 set_temp_high(dev, buf, offset-1); \
@@ -366,13 +366,13 @@ set_temp(1);
366set_temp(2); 366set_temp(2);
367set_temp(3); 367set_temp(3);
368 368
369static ssize_t show_temp_crit_int(struct device *dev, char *buf) 369static ssize_t show_temp_crit_int(struct device *dev, struct device_attribute *attr, char *buf)
370{ 370{
371 struct lm87_data *data = lm87_update_device(dev); 371 struct lm87_data *data = lm87_update_device(dev);
372 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int)); 372 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int));
373} 373}
374 374
375static ssize_t show_temp_crit_ext(struct device *dev, char *buf) 375static ssize_t show_temp_crit_ext(struct device *dev, struct device_attribute *attr, char *buf)
376{ 376{
377 struct lm87_data *data = lm87_update_device(dev); 377 struct lm87_data *data = lm87_update_device(dev);
378 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext)); 378 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext));
@@ -383,19 +383,19 @@ static DEVICE_ATTR(temp2_crit, S_IRUGO, show_temp_crit_ext, NULL);
383static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL); 383static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL);
384 384
385#define show_fan(offset) \ 385#define show_fan(offset) \
386static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ 386static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
387{ \ 387{ \
388 struct lm87_data *data = lm87_update_device(dev); \ 388 struct lm87_data *data = lm87_update_device(dev); \
389 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \ 389 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \
390 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ 390 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \
391} \ 391} \
392static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 392static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
393{ \ 393{ \
394 struct lm87_data *data = lm87_update_device(dev); \ 394 struct lm87_data *data = lm87_update_device(dev); \
395 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \ 395 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \
396 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ 396 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \
397} \ 397} \
398static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 398static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
399{ \ 399{ \
400 struct lm87_data *data = lm87_update_device(dev); \ 400 struct lm87_data *data = lm87_update_device(dev); \
401 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \ 401 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \
@@ -465,13 +465,13 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
465} 465}
466 466
467#define set_fan(offset) \ 467#define set_fan(offset) \
468static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 468static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
469 size_t count) \ 469 size_t count) \
470{ \ 470{ \
471 set_fan_min(dev, buf, offset-1); \ 471 set_fan_min(dev, buf, offset-1); \
472 return count; \ 472 return count; \
473} \ 473} \
474static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ 474static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \
475 size_t count) \ 475 size_t count) \
476{ \ 476{ \
477 return set_fan_div(dev, buf, count, offset-1); \ 477 return set_fan_div(dev, buf, count, offset-1); \
@@ -483,26 +483,26 @@ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
483set_fan(1); 483set_fan(1);
484set_fan(2); 484set_fan(2);
485 485
486static ssize_t show_alarms(struct device *dev, char *buf) 486static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
487{ 487{
488 struct lm87_data *data = lm87_update_device(dev); 488 struct lm87_data *data = lm87_update_device(dev);
489 return sprintf(buf, "%d\n", data->alarms); 489 return sprintf(buf, "%d\n", data->alarms);
490} 490}
491static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 491static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
492 492
493static ssize_t show_vid(struct device *dev, char *buf) 493static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
494{ 494{
495 struct lm87_data *data = lm87_update_device(dev); 495 struct lm87_data *data = lm87_update_device(dev);
496 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); 496 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
497} 497}
498static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 498static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
499 499
500static ssize_t show_vrm(struct device *dev, char *buf) 500static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
501{ 501{
502 struct lm87_data *data = lm87_update_device(dev); 502 struct lm87_data *data = lm87_update_device(dev);
503 return sprintf(buf, "%d\n", data->vrm); 503 return sprintf(buf, "%d\n", data->vrm);
504} 504}
505static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 505static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
506{ 506{
507 struct i2c_client *client = to_i2c_client(dev); 507 struct i2c_client *client = to_i2c_client(dev);
508 struct lm87_data *data = i2c_get_clientdata(client); 508 struct lm87_data *data = i2c_get_clientdata(client);
@@ -511,12 +511,12 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
511} 511}
512static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); 512static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
513 513
514static ssize_t show_aout(struct device *dev, char *buf) 514static ssize_t show_aout(struct device *dev, struct device_attribute *attr, char *buf)
515{ 515{
516 struct lm87_data *data = lm87_update_device(dev); 516 struct lm87_data *data = lm87_update_device(dev);
517 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout)); 517 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout));
518} 518}
519static ssize_t set_aout(struct device *dev, const char *buf, size_t count) 519static ssize_t set_aout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
520{ 520{
521 struct i2c_client *client = to_i2c_client(dev); 521 struct i2c_client *client = to_i2c_client(dev);
522 struct lm87_data *data = i2c_get_clientdata(client); 522 struct lm87_data *data = i2c_get_clientdata(client);