diff options
author | Yani Ioannou <yani.ioannou@gmail.com> | 2005-05-17 06:41:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:32 -0400 |
commit | 74880c063b06efd103c924abfe19d9d8fa4864c4 (patch) | |
tree | 7d0995426cec1f3577a5f8e5f61ada43a0df9813 /drivers | |
parent | ff381d2223a30ee70752791fd9c3588d8f1cab77 (diff) |
[PATCH] Driver Core: drivers/base - drivers/i2c/chips/adm1026.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')
-rw-r--r-- | drivers/base/dmapool.c | 2 | ||||
-rw-r--r-- | drivers/base/power/sysfs.c | 4 | ||||
-rw-r--r-- | drivers/block/ub.c | 2 | ||||
-rw-r--r-- | drivers/char/hvcs.c | 14 | ||||
-rw-r--r-- | drivers/char/mbcs.c | 4 | ||||
-rw-r--r-- | drivers/char/mwave/mwavedd.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 6 | ||||
-rw-r--r-- | drivers/dio/dio-sysfs.c | 10 | ||||
-rw-r--r-- | drivers/eisa/eisa-bus.c | 4 | ||||
-rw-r--r-- | drivers/i2c/chips/adm1021.c | 6 | ||||
-rw-r--r-- | drivers/i2c/chips/adm1025.c | 28 | ||||
-rw-r--r-- | drivers/i2c/chips/adm1026.c | 98 |
12 files changed, 90 insertions, 90 deletions
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c index f48833df61a2..c4aebf2f522d 100644 --- a/drivers/base/dmapool.c +++ b/drivers/base/dmapool.c | |||
@@ -41,7 +41,7 @@ struct dma_page { /* cacheable header for 'allocation' bytes */ | |||
41 | static DECLARE_MUTEX (pools_lock); | 41 | static DECLARE_MUTEX (pools_lock); |
42 | 42 | ||
43 | static ssize_t | 43 | static ssize_t |
44 | show_pools (struct device *dev, char *buf) | 44 | show_pools (struct device *dev, struct device_attribute *attr, char *buf) |
45 | { | 45 | { |
46 | unsigned temp; | 46 | unsigned temp; |
47 | unsigned size; | 47 | unsigned size; |
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index 6ac96349a8e8..f82b3df9545f 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
@@ -24,12 +24,12 @@ | |||
24 | * low-power state. | 24 | * low-power state. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | static ssize_t state_show(struct device * dev, char * buf) | 27 | static ssize_t state_show(struct device * dev, struct device_attribute *attr, char * buf) |
28 | { | 28 | { |
29 | return sprintf(buf, "%u\n", dev->power.power_state); | 29 | return sprintf(buf, "%u\n", dev->power.power_state); |
30 | } | 30 | } |
31 | 31 | ||
32 | static ssize_t state_store(struct device * dev, const char * buf, size_t n) | 32 | static ssize_t state_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n) |
33 | { | 33 | { |
34 | u32 state; | 34 | u32 state; |
35 | char * rest; | 35 | char * rest; |
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 19c5e59bcfa8..685f061e69b2 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -430,7 +430,7 @@ static void ub_cmdtr_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd, | |||
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | static ssize_t ub_diag_show(struct device *dev, char *page) | 433 | static ssize_t ub_diag_show(struct device *dev, struct device_attribute *attr, char *page) |
434 | { | 434 | { |
435 | struct usb_interface *intf; | 435 | struct usb_interface *intf; |
436 | struct ub_dev *sc; | 436 | struct ub_dev *sc; |
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index abfbdcfd4e72..3236d2404905 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c | |||
@@ -1466,7 +1466,7 @@ static inline struct hvcs_struct *from_vio_dev(struct vio_dev *viod) | |||
1466 | } | 1466 | } |
1467 | /* The sysfs interface for the driver and devices */ | 1467 | /* The sysfs interface for the driver and devices */ |
1468 | 1468 | ||
1469 | static ssize_t hvcs_partner_vtys_show(struct device *dev, char *buf) | 1469 | static ssize_t hvcs_partner_vtys_show(struct device *dev, struct device_attribute *attr, char *buf) |
1470 | { | 1470 | { |
1471 | struct vio_dev *viod = to_vio_dev(dev); | 1471 | struct vio_dev *viod = to_vio_dev(dev); |
1472 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1472 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1480,7 +1480,7 @@ static ssize_t hvcs_partner_vtys_show(struct device *dev, char *buf) | |||
1480 | } | 1480 | } |
1481 | static DEVICE_ATTR(partner_vtys, S_IRUGO, hvcs_partner_vtys_show, NULL); | 1481 | static DEVICE_ATTR(partner_vtys, S_IRUGO, hvcs_partner_vtys_show, NULL); |
1482 | 1482 | ||
1483 | static ssize_t hvcs_partner_clcs_show(struct device *dev, char *buf) | 1483 | static ssize_t hvcs_partner_clcs_show(struct device *dev, struct device_attribute *attr, char *buf) |
1484 | { | 1484 | { |
1485 | struct vio_dev *viod = to_vio_dev(dev); | 1485 | struct vio_dev *viod = to_vio_dev(dev); |
1486 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1486 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1494,7 +1494,7 @@ static ssize_t hvcs_partner_clcs_show(struct device *dev, char *buf) | |||
1494 | } | 1494 | } |
1495 | static DEVICE_ATTR(partner_clcs, S_IRUGO, hvcs_partner_clcs_show, NULL); | 1495 | static DEVICE_ATTR(partner_clcs, S_IRUGO, hvcs_partner_clcs_show, NULL); |
1496 | 1496 | ||
1497 | static ssize_t hvcs_current_vty_store(struct device *dev, const char * buf, | 1497 | static ssize_t hvcs_current_vty_store(struct device *dev, struct device_attribute *attr, const char * buf, |
1498 | size_t count) | 1498 | size_t count) |
1499 | { | 1499 | { |
1500 | /* | 1500 | /* |
@@ -1505,7 +1505,7 @@ static ssize_t hvcs_current_vty_store(struct device *dev, const char * buf, | |||
1505 | return -EPERM; | 1505 | return -EPERM; |
1506 | } | 1506 | } |
1507 | 1507 | ||
1508 | static ssize_t hvcs_current_vty_show(struct device *dev, char *buf) | 1508 | static ssize_t hvcs_current_vty_show(struct device *dev, struct device_attribute *attr, char *buf) |
1509 | { | 1509 | { |
1510 | struct vio_dev *viod = to_vio_dev(dev); | 1510 | struct vio_dev *viod = to_vio_dev(dev); |
1511 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1511 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1521,7 +1521,7 @@ static ssize_t hvcs_current_vty_show(struct device *dev, char *buf) | |||
1521 | static DEVICE_ATTR(current_vty, | 1521 | static DEVICE_ATTR(current_vty, |
1522 | S_IRUGO | S_IWUSR, hvcs_current_vty_show, hvcs_current_vty_store); | 1522 | S_IRUGO | S_IWUSR, hvcs_current_vty_show, hvcs_current_vty_store); |
1523 | 1523 | ||
1524 | static ssize_t hvcs_vterm_state_store(struct device *dev, const char *buf, | 1524 | static ssize_t hvcs_vterm_state_store(struct device *dev, struct device_attribute *attr, const char *buf, |
1525 | size_t count) | 1525 | size_t count) |
1526 | { | 1526 | { |
1527 | struct vio_dev *viod = to_vio_dev(dev); | 1527 | struct vio_dev *viod = to_vio_dev(dev); |
@@ -1559,7 +1559,7 @@ static ssize_t hvcs_vterm_state_store(struct device *dev, const char *buf, | |||
1559 | return count; | 1559 | return count; |
1560 | } | 1560 | } |
1561 | 1561 | ||
1562 | static ssize_t hvcs_vterm_state_show(struct device *dev, char *buf) | 1562 | static ssize_t hvcs_vterm_state_show(struct device *dev, struct device_attribute *attr, char *buf) |
1563 | { | 1563 | { |
1564 | struct vio_dev *viod = to_vio_dev(dev); | 1564 | struct vio_dev *viod = to_vio_dev(dev); |
1565 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1565 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
@@ -1574,7 +1574,7 @@ static ssize_t hvcs_vterm_state_show(struct device *dev, char *buf) | |||
1574 | static DEVICE_ATTR(vterm_state, S_IRUGO | S_IWUSR, | 1574 | static DEVICE_ATTR(vterm_state, S_IRUGO | S_IWUSR, |
1575 | hvcs_vterm_state_show, hvcs_vterm_state_store); | 1575 | hvcs_vterm_state_show, hvcs_vterm_state_store); |
1576 | 1576 | ||
1577 | static ssize_t hvcs_index_show(struct device *dev, char *buf) | 1577 | static ssize_t hvcs_index_show(struct device *dev, struct device_attribute *attr, char *buf) |
1578 | { | 1578 | { |
1579 | struct vio_dev *viod = to_vio_dev(dev); | 1579 | struct vio_dev *viod = to_vio_dev(dev); |
1580 | struct hvcs_struct *hvcsd = from_vio_dev(viod); | 1580 | struct hvcs_struct *hvcsd = from_vio_dev(viod); |
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index ac9cfa9701ea..115dbb35334b 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c | |||
@@ -699,7 +699,7 @@ static inline int mbcs_hw_init(struct mbcs_soft *soft) | |||
699 | return 0; | 699 | return 0; |
700 | } | 700 | } |
701 | 701 | ||
702 | static ssize_t show_algo(struct device *dev, char *buf) | 702 | static ssize_t show_algo(struct device *dev, struct device_attribute *attr, char *buf) |
703 | { | 703 | { |
704 | struct cx_dev *cx_dev = to_cx_dev(dev); | 704 | struct cx_dev *cx_dev = to_cx_dev(dev); |
705 | struct mbcs_soft *soft = cx_dev->soft; | 705 | struct mbcs_soft *soft = cx_dev->soft; |
@@ -715,7 +715,7 @@ static ssize_t show_algo(struct device *dev, char *buf) | |||
715 | (debug0 >> 32), (debug0 & 0xffffffff)); | 715 | (debug0 >> 32), (debug0 & 0xffffffff)); |
716 | } | 716 | } |
717 | 717 | ||
718 | static ssize_t store_algo(struct device *dev, const char *buf, size_t count) | 718 | static ssize_t store_algo(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
719 | { | 719 | { |
720 | int n; | 720 | int n; |
721 | struct cx_dev *cx_dev = to_cx_dev(dev); | 721 | struct cx_dev *cx_dev = to_cx_dev(dev); |
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c index d37625d47746..d568991ac6b3 100644 --- a/drivers/char/mwave/mwavedd.c +++ b/drivers/char/mwave/mwavedd.c | |||
@@ -472,7 +472,7 @@ struct device mwave_device; | |||
472 | 472 | ||
473 | /* Prevent code redundancy, create a macro for mwave_show_* functions. */ | 473 | /* Prevent code redundancy, create a macro for mwave_show_* functions. */ |
474 | #define mwave_show_function(attr_name, format_string, field) \ | 474 | #define mwave_show_function(attr_name, format_string, field) \ |
475 | static ssize_t mwave_show_##attr_name(struct device *dev, char *buf) \ | 475 | static ssize_t mwave_show_##attr_name(struct device *dev, struct device_attribute *attr, char *buf) \ |
476 | { \ | 476 | { \ |
477 | DSP_3780I_CONFIG_SETTINGS *pSettings = \ | 477 | DSP_3780I_CONFIG_SETTINGS *pSettings = \ |
478 | &mwave_s_mdd.rBDData.rDspSettings; \ | 478 | &mwave_s_mdd.rBDData.rDspSettings; \ |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 87235330fdbe..8ce508b29865 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -212,7 +212,7 @@ static u8 pcrread[] = { | |||
212 | 0, 0, 0, 0 /* PCR index */ | 212 | 0, 0, 0, 0 /* PCR index */ |
213 | }; | 213 | }; |
214 | 214 | ||
215 | static ssize_t show_pcrs(struct device *dev, char *buf) | 215 | static ssize_t show_pcrs(struct device *dev, struct device_attribute *attr, char *buf) |
216 | { | 216 | { |
217 | u8 data[READ_PCR_RESULT_SIZE]; | 217 | u8 data[READ_PCR_RESULT_SIZE]; |
218 | ssize_t len; | 218 | ssize_t len; |
@@ -255,7 +255,7 @@ static u8 readpubek[] = { | |||
255 | 0, 0, 0, 124, /* TPM_ORD_ReadPubek */ | 255 | 0, 0, 0, 124, /* TPM_ORD_ReadPubek */ |
256 | }; | 256 | }; |
257 | 257 | ||
258 | static ssize_t show_pubek(struct device *dev, char *buf) | 258 | static ssize_t show_pubek(struct device *dev, struct device_attribute *attr, char *buf) |
259 | { | 259 | { |
260 | u8 data[READ_PUBEK_RESULT_SIZE]; | 260 | u8 data[READ_PUBEK_RESULT_SIZE]; |
261 | ssize_t len; | 261 | ssize_t len; |
@@ -330,7 +330,7 @@ static u8 cap_manufacturer[] = { | |||
330 | 0, 0, 1, 3 | 330 | 0, 0, 1, 3 |
331 | }; | 331 | }; |
332 | 332 | ||
333 | static ssize_t show_caps(struct device *dev, char *buf) | 333 | static ssize_t show_caps(struct device *dev, struct device_attribute *attr, char *buf) |
334 | { | 334 | { |
335 | u8 data[READ_PUBEK_RESULT_SIZE]; | 335 | u8 data[READ_PUBEK_RESULT_SIZE]; |
336 | ssize_t len; | 336 | ssize_t len; |
diff --git a/drivers/dio/dio-sysfs.c b/drivers/dio/dio-sysfs.c index d30591f69dd9..f46463038847 100644 --- a/drivers/dio/dio-sysfs.c +++ b/drivers/dio/dio-sysfs.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | /* show configuration fields */ | 18 | /* show configuration fields */ |
19 | 19 | ||
20 | static ssize_t dio_show_id(struct device *dev, char *buf) | 20 | static ssize_t dio_show_id(struct device *dev, struct device_attribute *attr, char *buf) |
21 | { | 21 | { |
22 | struct dio_dev *d; | 22 | struct dio_dev *d; |
23 | 23 | ||
@@ -26,7 +26,7 @@ static ssize_t dio_show_id(struct device *dev, char *buf) | |||
26 | } | 26 | } |
27 | static DEVICE_ATTR(id, S_IRUGO, dio_show_id, NULL); | 27 | static DEVICE_ATTR(id, S_IRUGO, dio_show_id, NULL); |
28 | 28 | ||
29 | static ssize_t dio_show_ipl(struct device *dev, char *buf) | 29 | static ssize_t dio_show_ipl(struct device *dev, struct device_attribute *attr, char *buf) |
30 | { | 30 | { |
31 | struct dio_dev *d; | 31 | struct dio_dev *d; |
32 | 32 | ||
@@ -35,7 +35,7 @@ static ssize_t dio_show_ipl(struct device *dev, char *buf) | |||
35 | } | 35 | } |
36 | static DEVICE_ATTR(ipl, S_IRUGO, dio_show_ipl, NULL); | 36 | static DEVICE_ATTR(ipl, S_IRUGO, dio_show_ipl, NULL); |
37 | 37 | ||
38 | static ssize_t dio_show_secid(struct device *dev, char *buf) | 38 | static ssize_t dio_show_secid(struct device *dev, struct device_attribute *attr, char *buf) |
39 | { | 39 | { |
40 | struct dio_dev *d; | 40 | struct dio_dev *d; |
41 | 41 | ||
@@ -44,7 +44,7 @@ static ssize_t dio_show_secid(struct device *dev, char *buf) | |||
44 | } | 44 | } |
45 | static DEVICE_ATTR(secid, S_IRUGO, dio_show_secid, NULL); | 45 | static DEVICE_ATTR(secid, S_IRUGO, dio_show_secid, NULL); |
46 | 46 | ||
47 | static ssize_t dio_show_name(struct device *dev, char *buf) | 47 | static ssize_t dio_show_name(struct device *dev, struct device_attribute *attr, char *buf) |
48 | { | 48 | { |
49 | struct dio_dev *d; | 49 | struct dio_dev *d; |
50 | 50 | ||
@@ -53,7 +53,7 @@ static ssize_t dio_show_name(struct device *dev, char *buf) | |||
53 | } | 53 | } |
54 | static DEVICE_ATTR(name, S_IRUGO, dio_show_name, NULL); | 54 | static DEVICE_ATTR(name, S_IRUGO, dio_show_name, NULL); |
55 | 55 | ||
56 | static ssize_t dio_show_resource(struct device *dev, char *buf) | 56 | static ssize_t dio_show_resource(struct device *dev, struct device_attribute *attr, char *buf) |
57 | { | 57 | { |
58 | struct dio_dev *d = to_dio_dev(dev); | 58 | struct dio_dev *d = to_dio_dev(dev); |
59 | 59 | ||
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c index 6381ba53853c..1937743c8e29 100644 --- a/drivers/eisa/eisa-bus.c +++ b/drivers/eisa/eisa-bus.c | |||
@@ -149,7 +149,7 @@ void eisa_driver_unregister (struct eisa_driver *edrv) | |||
149 | driver_unregister (&edrv->driver); | 149 | driver_unregister (&edrv->driver); |
150 | } | 150 | } |
151 | 151 | ||
152 | static ssize_t eisa_show_sig (struct device *dev, char *buf) | 152 | static ssize_t eisa_show_sig (struct device *dev, struct device_attribute *attr, char *buf) |
153 | { | 153 | { |
154 | struct eisa_device *edev = to_eisa_device (dev); | 154 | struct eisa_device *edev = to_eisa_device (dev); |
155 | return sprintf (buf,"%s\n", edev->id.sig); | 155 | return sprintf (buf,"%s\n", edev->id.sig); |
@@ -157,7 +157,7 @@ static ssize_t eisa_show_sig (struct device *dev, char *buf) | |||
157 | 157 | ||
158 | static DEVICE_ATTR(signature, S_IRUGO, eisa_show_sig, NULL); | 158 | static DEVICE_ATTR(signature, S_IRUGO, eisa_show_sig, NULL); |
159 | 159 | ||
160 | static ssize_t eisa_show_state (struct device *dev, char *buf) | 160 | static ssize_t eisa_show_state (struct device *dev, struct device_attribute *attr, char *buf) |
161 | { | 161 | { |
162 | struct eisa_device *edev = to_eisa_device (dev); | 162 | struct eisa_device *edev = to_eisa_device (dev); |
163 | return sprintf (buf,"%d\n", edev->state & EISA_CONFIG_ENABLED); | 163 | return sprintf (buf,"%d\n", edev->state & EISA_CONFIG_ENABLED); |
diff --git a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c index 9c59a370b6d9..9058c3956710 100644 --- a/drivers/i2c/chips/adm1021.c +++ b/drivers/i2c/chips/adm1021.c | |||
@@ -137,7 +137,7 @@ static struct i2c_driver adm1021_driver = { | |||
137 | }; | 137 | }; |
138 | 138 | ||
139 | #define show(value) \ | 139 | #define show(value) \ |
140 | static ssize_t show_##value(struct device *dev, char *buf) \ | 140 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
141 | { \ | 141 | { \ |
142 | struct adm1021_data *data = adm1021_update_device(dev); \ | 142 | struct adm1021_data *data = adm1021_update_device(dev); \ |
143 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ | 143 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ |
@@ -150,7 +150,7 @@ show(remote_temp_hyst); | |||
150 | show(remote_temp_input); | 150 | show(remote_temp_input); |
151 | 151 | ||
152 | #define show2(value) \ | 152 | #define show2(value) \ |
153 | static ssize_t show_##value(struct device *dev, char *buf) \ | 153 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
154 | { \ | 154 | { \ |
155 | struct adm1021_data *data = adm1021_update_device(dev); \ | 155 | struct adm1021_data *data = adm1021_update_device(dev); \ |
156 | return sprintf(buf, "%d\n", data->value); \ | 156 | return sprintf(buf, "%d\n", data->value); \ |
@@ -159,7 +159,7 @@ show2(alarms); | |||
159 | show2(die_code); | 159 | show2(die_code); |
160 | 160 | ||
161 | #define set(value, reg) \ | 161 | #define set(value, reg) \ |
162 | static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ | 162 | static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ |
163 | { \ | 163 | { \ |
164 | struct i2c_client *client = to_i2c_client(dev); \ | 164 | struct i2c_client *client = to_i2c_client(dev); \ |
165 | struct adm1021_data *data = i2c_get_clientdata(client); \ | 165 | struct adm1021_data *data = i2c_get_clientdata(client); \ |
diff --git a/drivers/i2c/chips/adm1025.c b/drivers/i2c/chips/adm1025.c index e0771a3d05c9..111f0c86c933 100644 --- a/drivers/i2c/chips/adm1025.c +++ b/drivers/i2c/chips/adm1025.c | |||
@@ -153,19 +153,19 @@ struct adm1025_data { | |||
153 | */ | 153 | */ |
154 | 154 | ||
155 | #define show_in(offset) \ | 155 | #define show_in(offset) \ |
156 | static ssize_t show_in##offset(struct device *dev, char *buf) \ | 156 | static ssize_t show_in##offset(struct device *dev, struct device_attribute *attr, char *buf) \ |
157 | { \ | 157 | { \ |
158 | struct adm1025_data *data = adm1025_update_device(dev); \ | 158 | struct adm1025_data *data = adm1025_update_device(dev); \ |
159 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ | 159 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ |
160 | in_scale[offset])); \ | 160 | in_scale[offset])); \ |
161 | } \ | 161 | } \ |
162 | static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ | 162 | static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ |
163 | { \ | 163 | { \ |
164 | struct adm1025_data *data = adm1025_update_device(dev); \ | 164 | struct adm1025_data *data = adm1025_update_device(dev); \ |
165 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ | 165 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ |
166 | in_scale[offset])); \ | 166 | in_scale[offset])); \ |
167 | } \ | 167 | } \ |
168 | static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ | 168 | static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ |
169 | { \ | 169 | { \ |
170 | struct adm1025_data *data = adm1025_update_device(dev); \ | 170 | struct adm1025_data *data = adm1025_update_device(dev); \ |
171 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ | 171 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ |
@@ -180,17 +180,17 @@ show_in(4); | |||
180 | show_in(5); | 180 | show_in(5); |
181 | 181 | ||
182 | #define show_temp(offset) \ | 182 | #define show_temp(offset) \ |
183 | static ssize_t show_temp##offset(struct device *dev, char *buf) \ | 183 | static ssize_t show_temp##offset(struct device *dev, struct device_attribute *attr, char *buf) \ |
184 | { \ | 184 | { \ |
185 | struct adm1025_data *data = adm1025_update_device(dev); \ | 185 | struct adm1025_data *data = adm1025_update_device(dev); \ |
186 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ | 186 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ |
187 | } \ | 187 | } \ |
188 | static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ | 188 | static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ |
189 | { \ | 189 | { \ |
190 | struct adm1025_data *data = adm1025_update_device(dev); \ | 190 | struct adm1025_data *data = adm1025_update_device(dev); \ |
191 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ | 191 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ |
192 | } \ | 192 | } \ |
193 | static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ | 193 | static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ |
194 | { \ | 194 | { \ |
195 | struct adm1025_data *data = adm1025_update_device(dev); \ | 195 | struct adm1025_data *data = adm1025_update_device(dev); \ |
196 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ | 196 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ |
@@ -200,7 +200,7 @@ show_temp(1); | |||
200 | show_temp(2); | 200 | show_temp(2); |
201 | 201 | ||
202 | #define set_in(offset) \ | 202 | #define set_in(offset) \ |
203 | static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ | 203 | static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ |
204 | size_t count) \ | 204 | size_t count) \ |
205 | { \ | 205 | { \ |
206 | struct i2c_client *client = to_i2c_client(dev); \ | 206 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -214,7 +214,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ | |||
214 | up(&data->update_lock); \ | 214 | up(&data->update_lock); \ |
215 | return count; \ | 215 | return count; \ |
216 | } \ | 216 | } \ |
217 | static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ | 217 | static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \ |
218 | size_t count) \ | 218 | size_t count) \ |
219 | { \ | 219 | { \ |
220 | struct i2c_client *client = to_i2c_client(dev); \ | 220 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -240,7 +240,7 @@ set_in(4); | |||
240 | set_in(5); | 240 | set_in(5); |
241 | 241 | ||
242 | #define set_temp(offset) \ | 242 | #define set_temp(offset) \ |
243 | static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ | 243 | static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ |
244 | size_t count) \ | 244 | size_t count) \ |
245 | { \ | 245 | { \ |
246 | struct i2c_client *client = to_i2c_client(dev); \ | 246 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -254,7 +254,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ | |||
254 | up(&data->update_lock); \ | 254 | up(&data->update_lock); \ |
255 | return count; \ | 255 | return count; \ |
256 | } \ | 256 | } \ |
257 | static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ | 257 | static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \ |
258 | size_t count) \ | 258 | size_t count) \ |
259 | { \ | 259 | { \ |
260 | struct i2c_client *client = to_i2c_client(dev); \ | 260 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -275,26 +275,26 @@ static DEVICE_ATTR(temp##offset##_max, S_IWUSR | S_IRUGO, \ | |||
275 | set_temp(1); | 275 | set_temp(1); |
276 | set_temp(2); | 276 | set_temp(2); |
277 | 277 | ||
278 | static ssize_t show_alarms(struct device *dev, char *buf) | 278 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
279 | { | 279 | { |
280 | struct adm1025_data *data = adm1025_update_device(dev); | 280 | struct adm1025_data *data = adm1025_update_device(dev); |
281 | return sprintf(buf, "%u\n", data->alarms); | 281 | return sprintf(buf, "%u\n", data->alarms); |
282 | } | 282 | } |
283 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | 283 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
284 | 284 | ||
285 | static ssize_t show_vid(struct device *dev, char *buf) | 285 | static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) |
286 | { | 286 | { |
287 | struct adm1025_data *data = adm1025_update_device(dev); | 287 | struct adm1025_data *data = adm1025_update_device(dev); |
288 | return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); | 288 | return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); |
289 | } | 289 | } |
290 | static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL); | 290 | static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL); |
291 | 291 | ||
292 | static ssize_t show_vrm(struct device *dev, char *buf) | 292 | static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf) |
293 | { | 293 | { |
294 | struct adm1025_data *data = adm1025_update_device(dev); | 294 | struct adm1025_data *data = adm1025_update_device(dev); |
295 | return sprintf(buf, "%u\n", data->vrm); | 295 | return sprintf(buf, "%u\n", data->vrm); |
296 | } | 296 | } |
297 | static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) | 297 | static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
298 | { | 298 | { |
299 | struct i2c_client *client = to_i2c_client(dev); | 299 | struct i2c_client *client = to_i2c_client(dev); |
300 | struct adm1025_data *data = i2c_get_clientdata(client); | 300 | struct adm1025_data *data = i2c_get_clientdata(client); |
diff --git a/drivers/i2c/chips/adm1026.c b/drivers/i2c/chips/adm1026.c index 39e2f4a900bf..c127bd965c31 100644 --- a/drivers/i2c/chips/adm1026.c +++ b/drivers/i2c/chips/adm1026.c | |||
@@ -754,24 +754,24 @@ static ssize_t set_in_max(struct device *dev, const char *buf, | |||
754 | } | 754 | } |
755 | 755 | ||
756 | #define in_reg(offset) \ | 756 | #define in_reg(offset) \ |
757 | static ssize_t show_in##offset (struct device *dev, char *buf) \ | 757 | static ssize_t show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
758 | { \ | 758 | { \ |
759 | return show_in(dev, buf, offset); \ | 759 | return show_in(dev, buf, offset); \ |
760 | } \ | 760 | } \ |
761 | static ssize_t show_in##offset##_min (struct device *dev, char *buf) \ | 761 | static ssize_t show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ |
762 | { \ | 762 | { \ |
763 | return show_in_min(dev, buf, offset); \ | 763 | return show_in_min(dev, buf, offset); \ |
764 | } \ | 764 | } \ |
765 | static ssize_t set_in##offset##_min (struct device *dev, \ | 765 | static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \ |
766 | const char *buf, size_t count) \ | 766 | const char *buf, size_t count) \ |
767 | { \ | 767 | { \ |
768 | return set_in_min(dev, buf, count, offset); \ | 768 | return set_in_min(dev, buf, count, offset); \ |
769 | } \ | 769 | } \ |
770 | static ssize_t show_in##offset##_max (struct device *dev, char *buf) \ | 770 | static ssize_t show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ |
771 | { \ | 771 | { \ |
772 | return show_in_max(dev, buf, offset); \ | 772 | return show_in_max(dev, buf, offset); \ |
773 | } \ | 773 | } \ |
774 | static ssize_t set_in##offset##_max (struct device *dev, \ | 774 | static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \ |
775 | const char *buf, size_t count) \ | 775 | const char *buf, size_t count) \ |
776 | { \ | 776 | { \ |
777 | return set_in_max(dev, buf, count, offset); \ | 777 | return set_in_max(dev, buf, count, offset); \ |
@@ -800,19 +800,19 @@ in_reg(13); | |||
800 | in_reg(14); | 800 | in_reg(14); |
801 | in_reg(15); | 801 | in_reg(15); |
802 | 802 | ||
803 | static ssize_t show_in16(struct device *dev, char *buf) | 803 | static ssize_t show_in16(struct device *dev, struct device_attribute *attr, char *buf) |
804 | { | 804 | { |
805 | struct adm1026_data *data = adm1026_update_device(dev); | 805 | struct adm1026_data *data = adm1026_update_device(dev); |
806 | return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) - | 806 | return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) - |
807 | NEG12_OFFSET); | 807 | NEG12_OFFSET); |
808 | } | 808 | } |
809 | static ssize_t show_in16_min(struct device *dev, char *buf) | 809 | static ssize_t show_in16_min(struct device *dev, struct device_attribute *attr, char *buf) |
810 | { | 810 | { |
811 | struct adm1026_data *data = adm1026_update_device(dev); | 811 | struct adm1026_data *data = adm1026_update_device(dev); |
812 | return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16]) | 812 | return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16]) |
813 | - NEG12_OFFSET); | 813 | - NEG12_OFFSET); |
814 | } | 814 | } |
815 | static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count) | 815 | static ssize_t set_in16_min(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
816 | { | 816 | { |
817 | struct i2c_client *client = to_i2c_client(dev); | 817 | struct i2c_client *client = to_i2c_client(dev); |
818 | struct adm1026_data *data = i2c_get_clientdata(client); | 818 | struct adm1026_data *data = i2c_get_clientdata(client); |
@@ -824,13 +824,13 @@ static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count) | |||
824 | up(&data->update_lock); | 824 | up(&data->update_lock); |
825 | return count; | 825 | return count; |
826 | } | 826 | } |
827 | static ssize_t show_in16_max(struct device *dev, char *buf) | 827 | static ssize_t show_in16_max(struct device *dev, struct device_attribute *attr, char *buf) |
828 | { | 828 | { |
829 | struct adm1026_data *data = adm1026_update_device(dev); | 829 | struct adm1026_data *data = adm1026_update_device(dev); |
830 | return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16]) | 830 | return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16]) |
831 | - NEG12_OFFSET); | 831 | - NEG12_OFFSET); |
832 | } | 832 | } |
833 | static ssize_t set_in16_max(struct device *dev, const char *buf, size_t count) | 833 | static ssize_t set_in16_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
834 | { | 834 | { |
835 | struct i2c_client *client = to_i2c_client(dev); | 835 | struct i2c_client *client = to_i2c_client(dev); |
836 | struct adm1026_data *data = i2c_get_clientdata(client); | 836 | struct adm1026_data *data = i2c_get_clientdata(client); |
@@ -880,15 +880,15 @@ static ssize_t set_fan_min(struct device *dev, const char *buf, | |||
880 | } | 880 | } |
881 | 881 | ||
882 | #define fan_offset(offset) \ | 882 | #define fan_offset(offset) \ |
883 | static ssize_t show_fan_##offset (struct device *dev, char *buf) \ | 883 | static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
884 | { \ | 884 | { \ |
885 | return show_fan(dev, buf, offset - 1); \ | 885 | return show_fan(dev, buf, offset - 1); \ |
886 | } \ | 886 | } \ |
887 | static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ | 887 | static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ |
888 | { \ | 888 | { \ |
889 | return show_fan_min(dev, buf, offset - 1); \ | 889 | return show_fan_min(dev, buf, offset - 1); \ |
890 | } \ | 890 | } \ |
891 | static ssize_t set_fan_##offset##_min (struct device *dev, \ | 891 | static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \ |
892 | const char *buf, size_t count) \ | 892 | const char *buf, size_t count) \ |
893 | { \ | 893 | { \ |
894 | return set_fan_min(dev, buf, count, offset - 1); \ | 894 | return set_fan_min(dev, buf, count, offset - 1); \ |
@@ -967,11 +967,11 @@ static ssize_t set_fan_div(struct device *dev, const char *buf, | |||
967 | } | 967 | } |
968 | 968 | ||
969 | #define fan_offset_div(offset) \ | 969 | #define fan_offset_div(offset) \ |
970 | static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ | 970 | static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \ |
971 | { \ | 971 | { \ |
972 | return show_fan_div(dev, buf, offset - 1); \ | 972 | return show_fan_div(dev, buf, offset - 1); \ |
973 | } \ | 973 | } \ |
974 | static ssize_t set_fan_##offset##_div (struct device *dev, \ | 974 | static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \ |
975 | const char *buf, size_t count) \ | 975 | const char *buf, size_t count) \ |
976 | { \ | 976 | { \ |
977 | return set_fan_div(dev, buf, count, offset - 1); \ | 977 | return set_fan_div(dev, buf, count, offset - 1); \ |
@@ -1033,24 +1033,24 @@ static ssize_t set_temp_max(struct device *dev, const char *buf, | |||
1033 | return count; | 1033 | return count; |
1034 | } | 1034 | } |
1035 | #define temp_reg(offset) \ | 1035 | #define temp_reg(offset) \ |
1036 | static ssize_t show_temp_##offset (struct device *dev, char *buf) \ | 1036 | static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
1037 | { \ | 1037 | { \ |
1038 | return show_temp(dev, buf, offset - 1); \ | 1038 | return show_temp(dev, buf, offset - 1); \ |
1039 | } \ | 1039 | } \ |
1040 | static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ | 1040 | static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ |
1041 | { \ | 1041 | { \ |
1042 | return show_temp_min(dev, buf, offset - 1); \ | 1042 | return show_temp_min(dev, buf, offset - 1); \ |
1043 | } \ | 1043 | } \ |
1044 | static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ | 1044 | static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ |
1045 | { \ | 1045 | { \ |
1046 | return show_temp_max(dev, buf, offset - 1); \ | 1046 | return show_temp_max(dev, buf, offset - 1); \ |
1047 | } \ | 1047 | } \ |
1048 | static ssize_t set_temp_##offset##_min (struct device *dev, \ | 1048 | static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \ |
1049 | const char *buf, size_t count) \ | 1049 | const char *buf, size_t count) \ |
1050 | { \ | 1050 | { \ |
1051 | return set_temp_min(dev, buf, count, offset - 1); \ | 1051 | return set_temp_min(dev, buf, count, offset - 1); \ |
1052 | } \ | 1052 | } \ |
1053 | static ssize_t set_temp_##offset##_max (struct device *dev, \ | 1053 | static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \ |
1054 | const char *buf, size_t count) \ | 1054 | const char *buf, size_t count) \ |
1055 | { \ | 1055 | { \ |
1056 | return set_temp_max(dev, buf, count, offset - 1); \ | 1056 | return set_temp_max(dev, buf, count, offset - 1); \ |
@@ -1087,11 +1087,11 @@ static ssize_t set_temp_offset(struct device *dev, const char *buf, | |||
1087 | } | 1087 | } |
1088 | 1088 | ||
1089 | #define temp_offset_reg(offset) \ | 1089 | #define temp_offset_reg(offset) \ |
1090 | static ssize_t show_temp_##offset##_offset (struct device *dev, char *buf) \ | 1090 | static ssize_t show_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, char *buf) \ |
1091 | { \ | 1091 | { \ |
1092 | return show_temp_offset(dev, buf, offset - 1); \ | 1092 | return show_temp_offset(dev, buf, offset - 1); \ |
1093 | } \ | 1093 | } \ |
1094 | static ssize_t set_temp_##offset##_offset (struct device *dev, \ | 1094 | static ssize_t set_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, \ |
1095 | const char *buf, size_t count) \ | 1095 | const char *buf, size_t count) \ |
1096 | { \ | 1096 | { \ |
1097 | return set_temp_offset(dev, buf, count, offset - 1); \ | 1097 | return set_temp_offset(dev, buf, count, offset - 1); \ |
@@ -1139,22 +1139,22 @@ static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf, | |||
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | #define temp_auto_point(offset) \ | 1141 | #define temp_auto_point(offset) \ |
1142 | static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, \ | 1142 | static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \ |
1143 | char *buf) \ | 1143 | char *buf) \ |
1144 | { \ | 1144 | { \ |
1145 | return show_temp_auto_point1_temp(dev, buf, offset - 1); \ | 1145 | return show_temp_auto_point1_temp(dev, buf, offset - 1); \ |
1146 | } \ | 1146 | } \ |
1147 | static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, \ | 1147 | static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \ |
1148 | const char *buf, size_t count) \ | 1148 | const char *buf, size_t count) \ |
1149 | { \ | 1149 | { \ |
1150 | return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \ | 1150 | return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \ |
1151 | } \ | 1151 | } \ |
1152 | static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \ | 1152 | static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \ |
1153 | *dev, char *buf) \ | 1153 | *dev, struct device_attribute *attr, char *buf) \ |
1154 | { \ | 1154 | { \ |
1155 | return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \ | 1155 | return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \ |
1156 | } \ | 1156 | } \ |
1157 | static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, \ | 1157 | static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, struct device_attribute *attr, \ |
1158 | char *buf) \ | 1158 | char *buf) \ |
1159 | { \ | 1159 | { \ |
1160 | return show_temp_auto_point2_temp(dev, buf, offset - 1); \ | 1160 | return show_temp_auto_point2_temp(dev, buf, offset - 1); \ |
@@ -1171,12 +1171,12 @@ temp_auto_point(1); | |||
1171 | temp_auto_point(2); | 1171 | temp_auto_point(2); |
1172 | temp_auto_point(3); | 1172 | temp_auto_point(3); |
1173 | 1173 | ||
1174 | static ssize_t show_temp_crit_enable(struct device *dev, char *buf) | 1174 | static ssize_t show_temp_crit_enable(struct device *dev, struct device_attribute *attr, char *buf) |
1175 | { | 1175 | { |
1176 | struct adm1026_data *data = adm1026_update_device(dev); | 1176 | struct adm1026_data *data = adm1026_update_device(dev); |
1177 | return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4); | 1177 | return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4); |
1178 | } | 1178 | } |
1179 | static ssize_t set_temp_crit_enable(struct device *dev, const char *buf, | 1179 | static ssize_t set_temp_crit_enable(struct device *dev, struct device_attribute *attr, const char *buf, |
1180 | size_t count) | 1180 | size_t count) |
1181 | { | 1181 | { |
1182 | struct i2c_client *client = to_i2c_client(dev); | 1182 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1224,11 +1224,11 @@ static ssize_t set_temp_crit(struct device *dev, const char *buf, | |||
1224 | } | 1224 | } |
1225 | 1225 | ||
1226 | #define temp_crit_reg(offset) \ | 1226 | #define temp_crit_reg(offset) \ |
1227 | static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ | 1227 | static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \ |
1228 | { \ | 1228 | { \ |
1229 | return show_temp_crit(dev, buf, offset - 1); \ | 1229 | return show_temp_crit(dev, buf, offset - 1); \ |
1230 | } \ | 1230 | } \ |
1231 | static ssize_t set_temp_##offset##_crit (struct device *dev, \ | 1231 | static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \ |
1232 | const char *buf, size_t count) \ | 1232 | const char *buf, size_t count) \ |
1233 | { \ | 1233 | { \ |
1234 | return set_temp_crit(dev, buf, count, offset - 1); \ | 1234 | return set_temp_crit(dev, buf, count, offset - 1); \ |
@@ -1240,12 +1240,12 @@ temp_crit_reg(1); | |||
1240 | temp_crit_reg(2); | 1240 | temp_crit_reg(2); |
1241 | temp_crit_reg(3); | 1241 | temp_crit_reg(3); |
1242 | 1242 | ||
1243 | static ssize_t show_analog_out_reg(struct device *dev, char *buf) | 1243 | static ssize_t show_analog_out_reg(struct device *dev, struct device_attribute *attr, char *buf) |
1244 | { | 1244 | { |
1245 | struct adm1026_data *data = adm1026_update_device(dev); | 1245 | struct adm1026_data *data = adm1026_update_device(dev); |
1246 | return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out)); | 1246 | return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out)); |
1247 | } | 1247 | } |
1248 | static ssize_t set_analog_out_reg(struct device *dev, const char *buf, | 1248 | static ssize_t set_analog_out_reg(struct device *dev, struct device_attribute *attr, const char *buf, |
1249 | size_t count) | 1249 | size_t count) |
1250 | { | 1250 | { |
1251 | struct i2c_client *client = to_i2c_client(dev); | 1251 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1262,7 +1262,7 @@ static ssize_t set_analog_out_reg(struct device *dev, const char *buf, | |||
1262 | static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg, | 1262 | static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg, |
1263 | set_analog_out_reg); | 1263 | set_analog_out_reg); |
1264 | 1264 | ||
1265 | static ssize_t show_vid_reg(struct device *dev, char *buf) | 1265 | static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf) |
1266 | { | 1266 | { |
1267 | struct adm1026_data *data = adm1026_update_device(dev); | 1267 | struct adm1026_data *data = adm1026_update_device(dev); |
1268 | return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm)); | 1268 | return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm)); |
@@ -1270,12 +1270,12 @@ static ssize_t show_vid_reg(struct device *dev, char *buf) | |||
1270 | 1270 | ||
1271 | static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL); | 1271 | static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL); |
1272 | 1272 | ||
1273 | static ssize_t show_vrm_reg(struct device *dev, char *buf) | 1273 | static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf) |
1274 | { | 1274 | { |
1275 | struct adm1026_data *data = adm1026_update_device(dev); | 1275 | struct adm1026_data *data = adm1026_update_device(dev); |
1276 | return sprintf(buf,"%d\n", data->vrm); | 1276 | return sprintf(buf,"%d\n", data->vrm); |
1277 | } | 1277 | } |
1278 | static ssize_t store_vrm_reg(struct device *dev, const char *buf, | 1278 | static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, |
1279 | size_t count) | 1279 | size_t count) |
1280 | { | 1280 | { |
1281 | struct i2c_client *client = to_i2c_client(dev); | 1281 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1287,7 +1287,7 @@ static ssize_t store_vrm_reg(struct device *dev, const char *buf, | |||
1287 | 1287 | ||
1288 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); | 1288 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); |
1289 | 1289 | ||
1290 | static ssize_t show_alarms_reg(struct device *dev, char *buf) | 1290 | static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf) |
1291 | { | 1291 | { |
1292 | struct adm1026_data *data = adm1026_update_device(dev); | 1292 | struct adm1026_data *data = adm1026_update_device(dev); |
1293 | return sprintf(buf, "%ld\n", (long) (data->alarms)); | 1293 | return sprintf(buf, "%ld\n", (long) (data->alarms)); |
@@ -1295,12 +1295,12 @@ static ssize_t show_alarms_reg(struct device *dev, char *buf) | |||
1295 | 1295 | ||
1296 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); | 1296 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); |
1297 | 1297 | ||
1298 | static ssize_t show_alarm_mask(struct device *dev, char *buf) | 1298 | static ssize_t show_alarm_mask(struct device *dev, struct device_attribute *attr, char *buf) |
1299 | { | 1299 | { |
1300 | struct adm1026_data *data = adm1026_update_device(dev); | 1300 | struct adm1026_data *data = adm1026_update_device(dev); |
1301 | return sprintf(buf,"%ld\n", data->alarm_mask); | 1301 | return sprintf(buf,"%ld\n", data->alarm_mask); |
1302 | } | 1302 | } |
1303 | static ssize_t set_alarm_mask(struct device *dev, const char *buf, | 1303 | static ssize_t set_alarm_mask(struct device *dev, struct device_attribute *attr, const char *buf, |
1304 | size_t count) | 1304 | size_t count) |
1305 | { | 1305 | { |
1306 | struct i2c_client *client = to_i2c_client(dev); | 1306 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1331,12 +1331,12 @@ static DEVICE_ATTR(alarm_mask, S_IRUGO | S_IWUSR, show_alarm_mask, | |||
1331 | set_alarm_mask); | 1331 | set_alarm_mask); |
1332 | 1332 | ||
1333 | 1333 | ||
1334 | static ssize_t show_gpio(struct device *dev, char *buf) | 1334 | static ssize_t show_gpio(struct device *dev, struct device_attribute *attr, char *buf) |
1335 | { | 1335 | { |
1336 | struct adm1026_data *data = adm1026_update_device(dev); | 1336 | struct adm1026_data *data = adm1026_update_device(dev); |
1337 | return sprintf(buf,"%ld\n", data->gpio); | 1337 | return sprintf(buf,"%ld\n", data->gpio); |
1338 | } | 1338 | } |
1339 | static ssize_t set_gpio(struct device *dev, const char *buf, | 1339 | static ssize_t set_gpio(struct device *dev, struct device_attribute *attr, const char *buf, |
1340 | size_t count) | 1340 | size_t count) |
1341 | { | 1341 | { |
1342 | struct i2c_client *client = to_i2c_client(dev); | 1342 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1359,12 +1359,12 @@ static ssize_t set_gpio(struct device *dev, const char *buf, | |||
1359 | static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio); | 1359 | static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio); |
1360 | 1360 | ||
1361 | 1361 | ||
1362 | static ssize_t show_gpio_mask(struct device *dev, char *buf) | 1362 | static ssize_t show_gpio_mask(struct device *dev, struct device_attribute *attr, char *buf) |
1363 | { | 1363 | { |
1364 | struct adm1026_data *data = adm1026_update_device(dev); | 1364 | struct adm1026_data *data = adm1026_update_device(dev); |
1365 | return sprintf(buf,"%ld\n", data->gpio_mask); | 1365 | return sprintf(buf,"%ld\n", data->gpio_mask); |
1366 | } | 1366 | } |
1367 | static ssize_t set_gpio_mask(struct device *dev, const char *buf, | 1367 | static ssize_t set_gpio_mask(struct device *dev, struct device_attribute *attr, const char *buf, |
1368 | size_t count) | 1368 | size_t count) |
1369 | { | 1369 | { |
1370 | struct i2c_client *client = to_i2c_client(dev); | 1370 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1386,12 +1386,12 @@ static ssize_t set_gpio_mask(struct device *dev, const char *buf, | |||
1386 | 1386 | ||
1387 | static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask); | 1387 | static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask); |
1388 | 1388 | ||
1389 | static ssize_t show_pwm_reg(struct device *dev, char *buf) | 1389 | static ssize_t show_pwm_reg(struct device *dev, struct device_attribute *attr, char *buf) |
1390 | { | 1390 | { |
1391 | struct adm1026_data *data = adm1026_update_device(dev); | 1391 | struct adm1026_data *data = adm1026_update_device(dev); |
1392 | return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm)); | 1392 | return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm)); |
1393 | } | 1393 | } |
1394 | static ssize_t set_pwm_reg(struct device *dev, const char *buf, | 1394 | static ssize_t set_pwm_reg(struct device *dev, struct device_attribute *attr, const char *buf, |
1395 | size_t count) | 1395 | size_t count) |
1396 | { | 1396 | { |
1397 | struct i2c_client *client = to_i2c_client(dev); | 1397 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1407,12 +1407,12 @@ static ssize_t set_pwm_reg(struct device *dev, const char *buf, | |||
1407 | } | 1407 | } |
1408 | return count; | 1408 | return count; |
1409 | } | 1409 | } |
1410 | static ssize_t show_auto_pwm_min(struct device *dev, char *buf) | 1410 | static ssize_t show_auto_pwm_min(struct device *dev, struct device_attribute *attr, char *buf) |
1411 | { | 1411 | { |
1412 | struct adm1026_data *data = adm1026_update_device(dev); | 1412 | struct adm1026_data *data = adm1026_update_device(dev); |
1413 | return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min); | 1413 | return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min); |
1414 | } | 1414 | } |
1415 | static ssize_t set_auto_pwm_min(struct device *dev, const char *buf, | 1415 | static ssize_t set_auto_pwm_min(struct device *dev, struct device_attribute *attr, const char *buf, |
1416 | size_t count) | 1416 | size_t count) |
1417 | { | 1417 | { |
1418 | struct i2c_client *client = to_i2c_client(dev); | 1418 | struct i2c_client *client = to_i2c_client(dev); |
@@ -1429,16 +1429,16 @@ static ssize_t set_auto_pwm_min(struct device *dev, const char *buf, | |||
1429 | up(&data->update_lock); | 1429 | up(&data->update_lock); |
1430 | return count; | 1430 | return count; |
1431 | } | 1431 | } |
1432 | static ssize_t show_auto_pwm_max(struct device *dev, char *buf) | 1432 | static ssize_t show_auto_pwm_max(struct device *dev, struct device_attribute *attr, char *buf) |
1433 | { | 1433 | { |
1434 | return sprintf(buf,"%d\n", ADM1026_PWM_MAX); | 1434 | return sprintf(buf,"%d\n", ADM1026_PWM_MAX); |
1435 | } | 1435 | } |
1436 | static ssize_t show_pwm_enable(struct device *dev, char *buf) | 1436 | static ssize_t show_pwm_enable(struct device *dev, struct device_attribute *attr, char *buf) |
1437 | { | 1437 | { |
1438 | struct adm1026_data *data = adm1026_update_device(dev); | 1438 | struct adm1026_data *data = adm1026_update_device(dev); |
1439 | return sprintf(buf,"%d\n", data->pwm1.enable); | 1439 | return sprintf(buf,"%d\n", data->pwm1.enable); |
1440 | } | 1440 | } |
1441 | static ssize_t set_pwm_enable(struct device *dev, const char *buf, | 1441 | static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr, const char *buf, |
1442 | size_t count) | 1442 | size_t count) |
1443 | { | 1443 | { |
1444 | struct i2c_client *client = to_i2c_client(dev); | 1444 | struct i2c_client *client = to_i2c_client(dev); |