Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Yani Ioannou and committed by
Greg Kroah-Hartman
74880c06 ff381d22

+90 -90
+1 -1
drivers/base/dmapool.c
··· 41 41 static DECLARE_MUTEX (pools_lock); 42 42 43 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 46 unsigned temp; 47 47 unsigned size;
+2 -2
drivers/base/power/sysfs.c
··· 24 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 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 34 u32 state; 35 35 char * rest;
+1 -1
drivers/block/ub.c
··· 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 435 struct usb_interface *intf; 436 436 struct ub_dev *sc;
+7 -7
drivers/char/hvcs.c
··· 1466 1466 } 1467 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 1471 struct vio_dev *viod = to_vio_dev(dev); 1472 1472 struct hvcs_struct *hvcsd = from_vio_dev(viod); ··· 1480 1480 } 1481 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 1485 struct vio_dev *viod = to_vio_dev(dev); 1486 1486 struct hvcs_struct *hvcsd = from_vio_dev(viod); ··· 1494 1494 } 1495 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 1498 size_t count) 1499 1499 { 1500 1500 /* ··· 1505 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 1510 struct vio_dev *viod = to_vio_dev(dev); 1511 1511 struct hvcs_struct *hvcsd = from_vio_dev(viod); ··· 1521 1521 static DEVICE_ATTR(current_vty, 1522 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 1525 size_t count) 1526 1526 { 1527 1527 struct vio_dev *viod = to_vio_dev(dev); ··· 1559 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 1564 struct vio_dev *viod = to_vio_dev(dev); 1565 1565 struct hvcs_struct *hvcsd = from_vio_dev(viod); ··· 1574 1574 static DEVICE_ATTR(vterm_state, S_IRUGO | S_IWUSR, 1575 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 1579 struct vio_dev *viod = to_vio_dev(dev); 1580 1580 struct hvcs_struct *hvcsd = from_vio_dev(viod);
+2 -2
drivers/char/mbcs.c
··· 699 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 704 struct cx_dev *cx_dev = to_cx_dev(dev); 705 705 struct mbcs_soft *soft = cx_dev->soft; ··· 715 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 720 int n; 721 721 struct cx_dev *cx_dev = to_cx_dev(dev);
+1 -1
drivers/char/mwave/mwavedd.c
··· 472 472 473 473 /* Prevent code redundancy, create a macro for mwave_show_* functions. */ 474 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 477 DSP_3780I_CONFIG_SETTINGS *pSettings = \ 478 478 &mwave_s_mdd.rBDData.rDspSettings; \
+3 -3
drivers/char/tpm/tpm.c
··· 212 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 217 u8 data[READ_PCR_RESULT_SIZE]; 218 218 ssize_t len; ··· 255 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 260 u8 data[READ_PUBEK_RESULT_SIZE]; 261 261 ssize_t len; ··· 330 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 335 u8 data[READ_PUBEK_RESULT_SIZE]; 336 336 ssize_t len;
+5 -5
drivers/dio/dio-sysfs.c
··· 17 17 18 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 22 struct dio_dev *d; 23 23 ··· 26 26 } 27 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 31 struct dio_dev *d; 32 32 ··· 35 35 } 36 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 40 struct dio_dev *d; 41 41 ··· 44 44 } 45 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 49 struct dio_dev *d; 50 50 ··· 53 53 } 54 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 58 struct dio_dev *d = to_dio_dev(dev); 59 59
+2 -2
drivers/eisa/eisa-bus.c
··· 149 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 154 struct eisa_device *edev = to_eisa_device (dev); 155 155 return sprintf (buf,"%s\n", edev->id.sig); ··· 157 157 158 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 162 struct eisa_device *edev = to_eisa_device (dev); 163 163 return sprintf (buf,"%d\n", edev->state & EISA_CONFIG_ENABLED);
+3 -3
drivers/i2c/chips/adm1021.c
··· 137 137 }; 138 138 139 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 142 struct adm1021_data *data = adm1021_update_device(dev); \ 143 143 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ ··· 150 150 show(remote_temp_input); 151 151 152 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 155 struct adm1021_data *data = adm1021_update_device(dev); \ 156 156 return sprintf(buf, "%d\n", data->value); \ ··· 159 159 show2(die_code); 160 160 161 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 164 struct i2c_client *client = to_i2c_client(dev); \ 165 165 struct adm1021_data *data = i2c_get_clientdata(client); \
+14 -14
drivers/i2c/chips/adm1025.c
··· 153 153 */ 154 154 155 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 158 struct adm1025_data *data = adm1025_update_device(dev); \ 159 159 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 160 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 164 struct adm1025_data *data = adm1025_update_device(dev); \ 165 165 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 166 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 170 struct adm1025_data *data = adm1025_update_device(dev); \ 171 171 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ ··· 180 180 show_in(5); 181 181 182 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 185 struct adm1025_data *data = adm1025_update_device(dev); \ 186 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 190 struct adm1025_data *data = adm1025_update_device(dev); \ 191 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 195 struct adm1025_data *data = adm1025_update_device(dev); \ 196 196 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ ··· 200 200 show_temp(2); 201 201 202 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 204 size_t count) \ 205 205 { \ 206 206 struct i2c_client *client = to_i2c_client(dev); \ ··· 214 214 up(&data->update_lock); \ 215 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 218 size_t count) \ 219 219 { \ 220 220 struct i2c_client *client = to_i2c_client(dev); \ ··· 240 240 set_in(5); 241 241 242 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 244 size_t count) \ 245 245 { \ 246 246 struct i2c_client *client = to_i2c_client(dev); \ ··· 254 254 up(&data->update_lock); \ 255 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 258 size_t count) \ 259 259 { \ 260 260 struct i2c_client *client = to_i2c_client(dev); \ ··· 275 275 set_temp(1); 276 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 280 struct adm1025_data *data = adm1025_update_device(dev); 281 281 return sprintf(buf, "%u\n", data->alarms); 282 282 } 283 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 287 struct adm1025_data *data = adm1025_update_device(dev); 288 288 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); 289 289 } 290 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 294 struct adm1025_data *data = adm1025_update_device(dev); 295 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 299 struct i2c_client *client = to_i2c_client(dev); 300 300 struct adm1025_data *data = i2c_get_clientdata(client);
+49 -49
drivers/i2c/chips/adm1026.c
··· 754 754 } 755 755 756 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 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 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 766 const char *buf, size_t count) \ 767 767 { \ 768 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 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 775 const char *buf, size_t count) \ 776 776 { \ 777 777 return set_in_max(dev, buf, count, offset); \ ··· 800 800 in_reg(14); 801 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 805 struct adm1026_data *data = adm1026_update_device(dev); 806 806 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) - 807 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 811 struct adm1026_data *data = adm1026_update_device(dev); 812 812 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16]) 813 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 817 struct i2c_client *client = to_i2c_client(dev); 818 818 struct adm1026_data *data = i2c_get_clientdata(client); ··· 824 824 up(&data->update_lock); 825 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 829 struct adm1026_data *data = adm1026_update_device(dev); 830 830 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16]) 831 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 835 struct i2c_client *client = to_i2c_client(dev); 836 836 struct adm1026_data *data = i2c_get_clientdata(client); ··· 880 880 } 881 881 882 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 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 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 892 const char *buf, size_t count) \ 893 893 { \ 894 894 return set_fan_min(dev, buf, count, offset - 1); \ ··· 967 967 } 968 968 969 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 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 975 const char *buf, size_t count) \ 976 976 { \ 977 977 return set_fan_div(dev, buf, count, offset - 1); \ ··· 1033 1033 return count; 1034 1034 } 1035 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 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 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 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 1049 const char *buf, size_t count) \ 1050 1050 { \ 1051 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 1054 const char *buf, size_t count) \ 1055 1055 { \ 1056 1056 return set_temp_max(dev, buf, count, offset - 1); \ ··· 1087 1087 } 1088 1088 1089 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 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 1095 const char *buf, size_t count) \ 1096 1096 { \ 1097 1097 return set_temp_offset(dev, buf, count, offset - 1); \ ··· 1139 1139 } 1140 1140 1141 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 1143 char *buf) \ 1144 1144 { \ 1145 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 1148 const char *buf, size_t count) \ 1149 1149 { \ 1150 1150 return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \ 1151 1151 } \ 1152 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 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 1158 char *buf) \ 1159 1159 { \ 1160 1160 return show_temp_auto_point2_temp(dev, buf, offset - 1); \ ··· 1171 1171 temp_auto_point(2); 1172 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 1176 struct adm1026_data *data = adm1026_update_device(dev); 1177 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 1180 size_t count) 1181 1181 { 1182 1182 struct i2c_client *client = to_i2c_client(dev); ··· 1224 1224 } 1225 1225 1226 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 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 1232 const char *buf, size_t count) \ 1233 1233 { \ 1234 1234 return set_temp_crit(dev, buf, count, offset - 1); \ ··· 1240 1240 temp_crit_reg(2); 1241 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 1245 struct adm1026_data *data = adm1026_update_device(dev); 1246 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 1249 size_t count) 1250 1250 { 1251 1251 struct i2c_client *client = to_i2c_client(dev); ··· 1262 1262 static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg, 1263 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 1267 struct adm1026_data *data = adm1026_update_device(dev); 1268 1268 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm)); ··· 1270 1270 1271 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 1275 struct adm1026_data *data = adm1026_update_device(dev); 1276 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 1279 size_t count) 1280 1280 { 1281 1281 struct i2c_client *client = to_i2c_client(dev); ··· 1287 1287 1288 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 1292 struct adm1026_data *data = adm1026_update_device(dev); 1293 1293 return sprintf(buf, "%ld\n", (long) (data->alarms)); ··· 1295 1295 1296 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 1300 struct adm1026_data *data = adm1026_update_device(dev); 1301 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 1304 size_t count) 1305 1305 { 1306 1306 struct i2c_client *client = to_i2c_client(dev); ··· 1331 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 1336 struct adm1026_data *data = adm1026_update_device(dev); 1337 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 1340 size_t count) 1341 1341 { 1342 1342 struct i2c_client *client = to_i2c_client(dev); ··· 1359 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 1364 struct adm1026_data *data = adm1026_update_device(dev); 1365 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 1368 size_t count) 1369 1369 { 1370 1370 struct i2c_client *client = to_i2c_client(dev); ··· 1386 1386 1387 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 1391 struct adm1026_data *data = adm1026_update_device(dev); 1392 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 1395 size_t count) 1396 1396 { 1397 1397 struct i2c_client *client = to_i2c_client(dev); ··· 1407 1407 } 1408 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 1412 struct adm1026_data *data = adm1026_update_device(dev); 1413 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 1416 size_t count) 1417 1417 { 1418 1418 struct i2c_client *client = to_i2c_client(dev); ··· 1429 1429 up(&data->update_lock); 1430 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 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 1438 struct adm1026_data *data = adm1026_update_device(dev); 1439 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 1442 size_t count) 1443 1443 { 1444 1444 struct i2c_client *client = to_i2c_client(dev);