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

hwmon: use simple i2c probe function

Many hwmon drivers don't use the id information provided by the old
i2c probe function, and the remainder can easily be adapted to the new
form ("probe_new") by calling i2c_match_id explicitly.

This avoids scanning the identifier tables during probes.

Drivers which didn't use the id are converted as-is; drivers which did
are modified as follows:

* if the information in i2c_client is sufficient, that's used instead
(client->name);
* anything else is handled by calling i2c_match_id() with the same
level of error-handling (if any) as before.

A few drivers aren't included in this patch because they have a
different set of maintainers. They will be covered by other patches.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20200813160222.1503401-1-steve@sk2.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Stephen Kitt and committed by
Guenter Roeck
67487038 dd431939

+250 -285
+2 -3
drivers/hwmon/ad7414.c
··· 169 169 170 170 ATTRIBUTE_GROUPS(ad7414); 171 171 172 - static int ad7414_probe(struct i2c_client *client, 173 - const struct i2c_device_id *dev_id) 172 + static int ad7414_probe(struct i2c_client *client) 174 173 { 175 174 struct device *dev = &client->dev; 176 175 struct ad7414_data *data; ··· 221 222 .name = "ad7414", 222 223 .of_match_table = of_match_ptr(ad7414_of_match), 223 224 }, 224 - .probe = ad7414_probe, 225 + .probe_new = ad7414_probe, 225 226 .id_table = ad7414_id, 226 227 }; 227 228
+5 -4
drivers/hwmon/ad7418.c
··· 230 230 } 231 231 } 232 232 233 - static int ad7418_probe(struct i2c_client *client, 234 - const struct i2c_device_id *id) 233 + static const struct i2c_device_id ad7418_id[]; 234 + 235 + static int ad7418_probe(struct i2c_client *client) 235 236 { 236 237 struct device *dev = &client->dev; 237 238 struct i2c_adapter *adapter = client->adapter; ··· 255 254 if (dev->of_node) 256 255 data->type = (enum chips)of_device_get_match_data(dev); 257 256 else 258 - data->type = id->driver_data; 257 + data->type = i2c_match_id(ad7418_id, client)->driver_data; 259 258 260 259 switch (data->type) { 261 260 case ad7416: ··· 306 305 .name = "ad7418", 307 306 .of_match_table = ad7418_dt_ids, 308 307 }, 309 - .probe = ad7418_probe, 308 + .probe_new = ad7418_probe, 310 309 .id_table = ad7418_id, 311 310 }; 312 311
+5 -4
drivers/hwmon/adm1021.c
··· 425 425 i2c_smbus_write_byte_data(client, ADM1021_REG_CONV_RATE_W, 0x04); 426 426 } 427 427 428 - static int adm1021_probe(struct i2c_client *client, 429 - const struct i2c_device_id *id) 428 + static const struct i2c_device_id adm1021_id[]; 429 + 430 + static int adm1021_probe(struct i2c_client *client) 430 431 { 431 432 struct device *dev = &client->dev; 432 433 struct adm1021_data *data; ··· 438 437 return -ENOMEM; 439 438 440 439 data->client = client; 441 - data->type = id->driver_data; 440 + data->type = i2c_match_id(adm1021_id, client)->driver_data; 442 441 mutex_init(&data->update_lock); 443 442 444 443 /* Initialize the ADM1021 chip */ ··· 473 472 .driver = { 474 473 .name = "adm1021", 475 474 }, 476 - .probe = adm1021_probe, 475 + .probe_new = adm1021_probe, 477 476 .id_table = adm1021_id, 478 477 .detect = adm1021_detect, 479 478 .address_list = normal_i2c,
+2 -3
drivers/hwmon/adm1025.c
··· 517 517 (reg&0x7E)|0x01); 518 518 } 519 519 520 - static int adm1025_probe(struct i2c_client *client, 521 - const struct i2c_device_id *id) 520 + static int adm1025_probe(struct i2c_client *client) 522 521 { 523 522 struct device *dev = &client->dev; 524 523 struct device *hwmon_dev; ··· 559 560 .driver = { 560 561 .name = "adm1025", 561 562 }, 562 - .probe = adm1025_probe, 563 + .probe_new = adm1025_probe, 563 564 .id_table = adm1025_id, 564 565 .detect = adm1025_detect, 565 566 .address_list = normal_i2c,
+2 -3
drivers/hwmon/adm1026.c
··· 1816 1816 } 1817 1817 } 1818 1818 1819 - static int adm1026_probe(struct i2c_client *client, 1820 - const struct i2c_device_id *id) 1819 + static int adm1026_probe(struct i2c_client *client) 1821 1820 { 1822 1821 struct device *dev = &client->dev; 1823 1822 struct device *hwmon_dev; ··· 1859 1860 .driver = { 1860 1861 .name = "adm1026", 1861 1862 }, 1862 - .probe = adm1026_probe, 1863 + .probe_new = adm1026_probe, 1863 1864 .id_table = adm1026_id, 1864 1865 .detect = adm1026_detect, 1865 1866 .address_list = normal_i2c,
+5 -4
drivers/hwmon/adm1031.c
··· 1022 1022 data->update_interval = update_intervals[i]; 1023 1023 } 1024 1024 1025 - static int adm1031_probe(struct i2c_client *client, 1026 - const struct i2c_device_id *id) 1025 + static const struct i2c_device_id adm1031_id[]; 1026 + 1027 + static int adm1031_probe(struct i2c_client *client) 1027 1028 { 1028 1029 struct device *dev = &client->dev; 1029 1030 struct device *hwmon_dev; ··· 1036 1035 1037 1036 i2c_set_clientdata(client, data); 1038 1037 data->client = client; 1039 - data->chip_type = id->driver_data; 1038 + data->chip_type = i2c_match_id(adm1031_id, client)->driver_data; 1040 1039 mutex_init(&data->update_lock); 1041 1040 1042 1041 if (data->chip_type == adm1030) ··· 1069 1068 .driver = { 1070 1069 .name = "adm1031", 1071 1070 }, 1072 - .probe = adm1031_probe, 1071 + .probe_new = adm1031_probe, 1073 1072 .id_table = adm1031_id, 1074 1073 .detect = adm1031_detect, 1075 1074 .address_list = normal_i2c,
+2 -3
drivers/hwmon/adm9240.c
··· 704 704 } 705 705 } 706 706 707 - static int adm9240_probe(struct i2c_client *new_client, 708 - const struct i2c_device_id *id) 707 + static int adm9240_probe(struct i2c_client *new_client) 709 708 { 710 709 struct device *dev = &new_client->dev; 711 710 struct device *hwmon_dev; ··· 740 741 .driver = { 741 742 .name = "adm9240", 742 743 }, 743 - .probe = adm9240_probe, 744 + .probe_new = adm9240_probe, 744 745 .id_table = adm9240_id, 745 746 .detect = adm9240_detect, 746 747 .address_list = normal_i2c,
+2 -3
drivers/hwmon/adt7410.c
··· 39 39 .write_byte = adt7410_i2c_write_byte, 40 40 }; 41 41 42 - static int adt7410_i2c_probe(struct i2c_client *client, 43 - const struct i2c_device_id *id) 42 + static int adt7410_i2c_probe(struct i2c_client *client) 44 43 { 45 44 if (!i2c_check_functionality(client->adapter, 46 45 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) ··· 66 67 .name = "adt7410", 67 68 .pm = ADT7X10_DEV_PM_OPS, 68 69 }, 69 - .probe = adt7410_i2c_probe, 70 + .probe_new = adt7410_i2c_probe, 70 71 .remove = adt7410_i2c_remove, 71 72 .id_table = adt7410_ids, 72 73 .address_list = I2C_ADDRS(0x48, 0x49, 0x4a, 0x4b),
+2 -3
drivers/hwmon/adt7411.c
··· 666 666 .info = adt7411_info, 667 667 }; 668 668 669 - static int adt7411_probe(struct i2c_client *client, 670 - const struct i2c_device_id *id) 669 + static int adt7411_probe(struct i2c_client *client) 671 670 { 672 671 struct device *dev = &client->dev; 673 672 struct adt7411_data *data; ··· 706 707 .driver = { 707 708 .name = "adt7411", 708 709 }, 709 - .probe = adt7411_probe, 710 + .probe_new = adt7411_probe, 710 711 .id_table = adt7411_id, 711 712 .detect = adt7411_detect, 712 713 .address_list = normal_i2c,
+2 -3
drivers/hwmon/adt7462.c
··· 1787 1787 return 0; 1788 1788 } 1789 1789 1790 - static int adt7462_probe(struct i2c_client *client, 1791 - const struct i2c_device_id *id) 1790 + static int adt7462_probe(struct i2c_client *client) 1792 1791 { 1793 1792 struct device *dev = &client->dev; 1794 1793 struct adt7462_data *data; ··· 1819 1820 .driver = { 1820 1821 .name = "adt7462", 1821 1822 }, 1822 - .probe = adt7462_probe, 1823 + .probe_new = adt7462_probe, 1823 1824 .id_table = adt7462_id, 1824 1825 .detect = adt7462_detect, 1825 1826 .address_list = normal_i2c,
+2 -3
drivers/hwmon/adt7470.c
··· 1217 1217 } 1218 1218 } 1219 1219 1220 - static int adt7470_probe(struct i2c_client *client, 1221 - const struct i2c_device_id *id) 1220 + static int adt7470_probe(struct i2c_client *client) 1222 1221 { 1223 1222 struct device *dev = &client->dev; 1224 1223 struct adt7470_data *data; ··· 1275 1276 .driver = { 1276 1277 .name = "adt7470", 1277 1278 }, 1278 - .probe = adt7470_probe, 1279 + .probe_new = adt7470_probe, 1279 1280 .remove = adt7470_remove, 1280 1281 .id_table = adt7470_id, 1281 1282 .detect = adt7470_detect,
+3 -3
drivers/hwmon/adt7475.c
··· 1539 1539 return 0; 1540 1540 } 1541 1541 1542 - static int adt7475_probe(struct i2c_client *client, 1543 - const struct i2c_device_id *id) 1542 + static int adt7475_probe(struct i2c_client *client) 1544 1543 { 1545 1544 enum chips chip; 1546 1545 static const char * const names[] = { ··· 1553 1554 struct device *hwmon_dev; 1554 1555 int i, ret = 0, revision, group_num = 0; 1555 1556 u8 config3; 1557 + const struct i2c_device_id *id = i2c_match_id(adt7475_id, client); 1556 1558 1557 1559 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); 1558 1560 if (data == NULL) ··· 1728 1728 .name = "adt7475", 1729 1729 .of_match_table = of_match_ptr(adt7475_of_match), 1730 1730 }, 1731 - .probe = adt7475_probe, 1731 + .probe_new = adt7475_probe, 1732 1732 .id_table = adt7475_id, 1733 1733 .detect = adt7475_detect, 1734 1734 .address_list = normal_i2c,
+2 -3
drivers/hwmon/amc6821.c
··· 900 900 return 0; 901 901 } 902 902 903 - static int amc6821_probe(struct i2c_client *client, 904 - const struct i2c_device_id *id) 903 + static int amc6821_probe(struct i2c_client *client) 905 904 { 906 905 struct device *dev = &client->dev; 907 906 struct amc6821_data *data; ··· 939 940 .driver = { 940 941 .name = "amc6821", 941 942 }, 942 - .probe = amc6821_probe, 943 + .probe_new = amc6821_probe, 943 944 .id_table = amc6821_id, 944 945 .detect = amc6821_detect, 945 946 .address_list = normal_i2c,
+3 -5
drivers/hwmon/asb100.c
··· 205 205 static int asb100_read_value(struct i2c_client *client, u16 reg); 206 206 static void asb100_write_value(struct i2c_client *client, u16 reg, u16 val); 207 207 208 - static int asb100_probe(struct i2c_client *client, 209 - const struct i2c_device_id *id); 208 + static int asb100_probe(struct i2c_client *client); 210 209 static int asb100_detect(struct i2c_client *client, 211 210 struct i2c_board_info *info); 212 211 static int asb100_remove(struct i2c_client *client); ··· 223 224 .driver = { 224 225 .name = "asb100", 225 226 }, 226 - .probe = asb100_probe, 227 + .probe_new = asb100_probe, 227 228 .remove = asb100_remove, 228 229 .id_table = asb100_id, 229 230 .detect = asb100_detect, ··· 774 775 return 0; 775 776 } 776 777 777 - static int asb100_probe(struct i2c_client *client, 778 - const struct i2c_device_id *id) 778 + static int asb100_probe(struct i2c_client *client) 779 779 { 780 780 int err; 781 781 struct asb100_data *data;
+2 -3
drivers/hwmon/atxp1.c
··· 244 244 }; 245 245 ATTRIBUTE_GROUPS(atxp1); 246 246 247 - static int atxp1_probe(struct i2c_client *client, 248 - const struct i2c_device_id *id) 247 + static int atxp1_probe(struct i2c_client *client) 249 248 { 250 249 struct device *dev = &client->dev; 251 250 struct atxp1_data *data; ··· 287 288 .driver = { 288 289 .name = "atxp1", 289 290 }, 290 - .probe = atxp1_probe, 291 + .probe_new = atxp1_probe, 291 292 .id_table = atxp1_id, 292 293 }; 293 294
+5 -4
drivers/hwmon/ds1621.c
··· 342 342 }; 343 343 __ATTRIBUTE_GROUPS(ds1621); 344 344 345 - static int ds1621_probe(struct i2c_client *client, 346 - const struct i2c_device_id *id) 345 + static const struct i2c_device_id ds1621_id[]; 346 + 347 + static int ds1621_probe(struct i2c_client *client) 347 348 { 348 349 struct ds1621_data *data; 349 350 struct device *hwmon_dev; ··· 356 355 357 356 mutex_init(&data->update_lock); 358 357 359 - data->kind = id->driver_data; 358 + data->kind = i2c_match_id(ds1621_id, client)->driver_data; 360 359 data->client = client; 361 360 362 361 /* Initialize the DS1621 chip */ ··· 384 383 .driver = { 385 384 .name = "ds1621", 386 385 }, 387 - .probe = ds1621_probe, 386 + .probe_new = ds1621_probe, 388 387 .id_table = ds1621_id, 389 388 }; 390 389
+2 -3
drivers/hwmon/ds620.c
··· 211 211 212 212 ATTRIBUTE_GROUPS(ds620); 213 213 214 - static int ds620_probe(struct i2c_client *client, 215 - const struct i2c_device_id *id) 214 + static int ds620_probe(struct i2c_client *client) 216 215 { 217 216 struct device *dev = &client->dev; 218 217 struct device *hwmon_dev; ··· 245 246 .driver = { 246 247 .name = "ds620", 247 248 }, 248 - .probe = ds620_probe, 249 + .probe_new = ds620_probe, 249 250 .id_table = ds620_id, 250 251 }; 251 252
+5 -3
drivers/hwmon/emc1403.c
··· 386 386 .volatile_reg = emc1403_regmap_is_volatile, 387 387 }; 388 388 389 - static int emc1403_probe(struct i2c_client *client, 390 - const struct i2c_device_id *id) 389 + static const struct i2c_device_id emc1403_idtable[]; 390 + 391 + static int emc1403_probe(struct i2c_client *client) 391 392 { 392 393 struct thermal_data *data; 393 394 struct device *hwmon_dev; 395 + const struct i2c_device_id *id = i2c_match_id(emc1403_idtable, client); 394 396 395 397 data = devm_kzalloc(&client->dev, sizeof(struct thermal_data), 396 398 GFP_KERNEL); ··· 454 452 .name = "emc1403", 455 453 }, 456 454 .detect = emc1403_detect, 457 - .probe = emc1403_probe, 455 + .probe_new = emc1403_probe, 458 456 .id_table = emc1403_idtable, 459 457 .address_list = emc1403_address_list, 460 458 };
+2 -3
drivers/hwmon/emc6w201.c
··· 444 444 return 0; 445 445 } 446 446 447 - static int emc6w201_probe(struct i2c_client *client, 448 - const struct i2c_device_id *id) 447 + static int emc6w201_probe(struct i2c_client *client) 449 448 { 450 449 struct device *dev = &client->dev; 451 450 struct emc6w201_data *data; ··· 474 475 .driver = { 475 476 .name = "emc6w201", 476 477 }, 477 - .probe = emc6w201_probe, 478 + .probe_new = emc6w201_probe, 478 479 .id_table = emc6w201_id, 479 480 .detect = emc6w201_detect, 480 481 .address_list = normal_i2c,
+4 -6
drivers/hwmon/fschmd.c
··· 214 214 * Functions declarations 215 215 */ 216 216 217 - static int fschmd_probe(struct i2c_client *client, 218 - const struct i2c_device_id *id); 217 + static int fschmd_probe(struct i2c_client *client); 219 218 static int fschmd_detect(struct i2c_client *client, 220 219 struct i2c_board_info *info); 221 220 static int fschmd_remove(struct i2c_client *client); ··· 241 242 .driver = { 242 243 .name = "fschmd", 243 244 }, 244 - .probe = fschmd_probe, 245 + .probe_new = fschmd_probe, 245 246 .remove = fschmd_remove, 246 247 .id_table = fschmd_id, 247 248 .detect = fschmd_detect, ··· 1080 1081 return 0; 1081 1082 } 1082 1083 1083 - static int fschmd_probe(struct i2c_client *client, 1084 - const struct i2c_device_id *id) 1084 + static int fschmd_probe(struct i2c_client *client) 1085 1085 { 1086 1086 struct fschmd_data *data; 1087 1087 const char * const names[7] = { "Poseidon", "Hermes", "Scylla", 1088 1088 "Heracles", "Heimdall", "Hades", "Syleus" }; 1089 1089 const int watchdog_minors[] = { WATCHDOG_MINOR, 212, 213, 214, 215 }; 1090 1090 int i, err; 1091 - enum chips kind = id->driver_data; 1091 + enum chips kind = i2c_match_id(fschmd_id, client)->driver_data; 1092 1092 1093 1093 data = kzalloc(sizeof(struct fschmd_data), GFP_KERNEL); 1094 1094 if (!data)
+2 -2
drivers/hwmon/ftsteutates.c
··· 752 752 return 0; 753 753 } 754 754 755 - static int fts_probe(struct i2c_client *client, const struct i2c_device_id *id) 755 + static int fts_probe(struct i2c_client *client) 756 756 { 757 757 u8 revision; 758 758 struct fts_data *data; ··· 819 819 .name = "ftsteutates", 820 820 }, 821 821 .id_table = fts_id, 822 - .probe = fts_probe, 822 + .probe_new = fts_probe, 823 823 .remove = fts_remove, 824 824 .detect = fts_detect, 825 825 .address_list = normal_i2c,
+2 -3
drivers/hwmon/g760a.c
··· 170 170 * new-style driver model code 171 171 */ 172 172 173 - static int g760a_probe(struct i2c_client *client, 174 - const struct i2c_device_id *id) 173 + static int g760a_probe(struct i2c_client *client) 175 174 { 176 175 struct device *dev = &client->dev; 177 176 struct g760a_data *data; ··· 206 207 .driver = { 207 208 .name = "g760a", 208 209 }, 209 - .probe = g760a_probe, 210 + .probe_new = g760a_probe, 210 211 .id_table = g760a_id, 211 212 }; 212 213
+2 -2
drivers/hwmon/g762.c
··· 1033 1033 data->fan_cmd1); 1034 1034 } 1035 1035 1036 - static int g762_probe(struct i2c_client *client, const struct i2c_device_id *id) 1036 + static int g762_probe(struct i2c_client *client) 1037 1037 { 1038 1038 struct device *dev = &client->dev; 1039 1039 struct device *hwmon_dev; ··· 1079 1079 .name = DRVNAME, 1080 1080 .of_match_table = of_match_ptr(g762_dt_match), 1081 1081 }, 1082 - .probe = g762_probe, 1082 + .probe_new = g762_probe, 1083 1083 .id_table = g762_id, 1084 1084 }; 1085 1085
+2 -3
drivers/hwmon/gl518sm.c
··· 611 611 gl518_write_value(client, GL518_REG_CONF, 0x40 | regvalue); 612 612 } 613 613 614 - static int gl518_probe(struct i2c_client *client, 615 - const struct i2c_device_id *id) 614 + static int gl518_probe(struct i2c_client *client) 616 615 { 617 616 struct device *dev = &client->dev; 618 617 struct device *hwmon_dev; ··· 652 653 .driver = { 653 654 .name = "gl518sm", 654 655 }, 655 - .probe = gl518_probe, 656 + .probe_new = gl518_probe, 656 657 .id_table = gl518_id, 657 658 .detect = gl518_detect, 658 659 .address_list = normal_i2c,
+2 -3
drivers/hwmon/gl520sm.c
··· 854 854 gl520_write_value(client, GL520_REG_BEEP_MASK, data->beep_mask); 855 855 } 856 856 857 - static int gl520_probe(struct i2c_client *client, 858 - const struct i2c_device_id *id) 857 + static int gl520_probe(struct i2c_client *client) 859 858 { 860 859 struct device *dev = &client->dev; 861 860 struct device *hwmon_dev; ··· 895 896 .driver = { 896 897 .name = "gl520sm", 897 898 }, 898 - .probe = gl520_probe, 899 + .probe_new = gl520_probe, 899 900 .id_table = gl520_id, 900 901 .detect = gl520_detect, 901 902 .address_list = normal_i2c,
+2 -3
drivers/hwmon/hih6130.c
··· 204 204 205 205 ATTRIBUTE_GROUPS(hih6130); 206 206 207 - static int hih6130_probe(struct i2c_client *client, 208 - const struct i2c_device_id *id) 207 + static int hih6130_probe(struct i2c_client *client) 209 208 { 210 209 struct device *dev = &client->dev; 211 210 struct hih6130 *hih6130; ··· 249 250 .name = "hih6130", 250 251 .of_match_table = of_match_ptr(hih6130_of_match), 251 252 }, 252 - .probe = hih6130_probe, 253 + .probe_new = hih6130_probe, 253 254 .id_table = hih6130_id, 254 255 }; 255 256
+2 -3
drivers/hwmon/ina209.c
··· 531 531 return 0; 532 532 } 533 533 534 - static int ina209_probe(struct i2c_client *client, 535 - const struct i2c_device_id *id) 534 + static int ina209_probe(struct i2c_client *client) 536 535 { 537 536 struct i2c_adapter *adapter = client->adapter; 538 537 struct ina209_data *data; ··· 596 597 .name = "ina209", 597 598 .of_match_table = of_match_ptr(ina209_of_match), 598 599 }, 599 - .probe = ina209_probe, 600 + .probe_new = ina209_probe, 600 601 .remove = ina209_remove, 601 602 .id_table = ina209_id, 602 603 };
+5 -4
drivers/hwmon/ina2xx.c
··· 614 614 .attrs = ina226_attrs, 615 615 }; 616 616 617 - static int ina2xx_probe(struct i2c_client *client, 618 - const struct i2c_device_id *id) 617 + static const struct i2c_device_id ina2xx_id[]; 618 + 619 + static int ina2xx_probe(struct i2c_client *client) 619 620 { 620 621 struct device *dev = &client->dev; 621 622 struct ina2xx_data *data; ··· 628 627 if (client->dev.of_node) 629 628 chip = (enum ina2xx_ids)of_device_get_match_data(&client->dev); 630 629 else 631 - chip = id->driver_data; 630 + chip = i2c_match_id(ina2xx_id, client)->driver_data; 632 631 633 632 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); 634 633 if (!data) ··· 718 717 .name = "ina2xx", 719 718 .of_match_table = of_match_ptr(ina2xx_of_match), 720 719 }, 721 - .probe = ina2xx_probe, 720 + .probe_new = ina2xx_probe, 722 721 .id_table = ina2xx_id, 723 722 }; 724 723
+2 -3
drivers/hwmon/ina3221.c
··· 822 822 return 0; 823 823 } 824 824 825 - static int ina3221_probe(struct i2c_client *client, 826 - const struct i2c_device_id *id) 825 + static int ina3221_probe(struct i2c_client *client) 827 826 { 828 827 struct device *dev = &client->dev; 829 828 struct ina3221_data *ina; ··· 1015 1016 MODULE_DEVICE_TABLE(i2c, ina3221_ids); 1016 1017 1017 1018 static struct i2c_driver ina3221_i2c_driver = { 1018 - .probe = ina3221_probe, 1019 + .probe_new = ina3221_probe, 1019 1020 .remove = ina3221_remove, 1020 1021 .driver = { 1021 1022 .name = INA3221_DRIVER_NAME,
+2 -2
drivers/hwmon/jc42.c
··· 458 458 .info = jc42_info, 459 459 }; 460 460 461 - static int jc42_probe(struct i2c_client *client, const struct i2c_device_id *id) 461 + static int jc42_probe(struct i2c_client *client) 462 462 { 463 463 struct device *dev = &client->dev; 464 464 struct device *hwmon_dev; ··· 581 581 .pm = JC42_DEV_PM_OPS, 582 582 .of_match_table = of_match_ptr(jc42_of_ids), 583 583 }, 584 - .probe = jc42_probe, 584 + .probe_new = jc42_probe, 585 585 .remove = jc42_remove, 586 586 .id_table = jc42_id, 587 587 .detect = jc42_detect,
+2 -3
drivers/hwmon/lineage-pem.c
··· 417 417 .attrs = pem_fan_attributes, 418 418 }; 419 419 420 - static int pem_probe(struct i2c_client *client, 421 - const struct i2c_device_id *id) 420 + static int pem_probe(struct i2c_client *client) 422 421 { 423 422 struct i2c_adapter *adapter = client->adapter; 424 423 struct device *dev = &client->dev; ··· 511 512 .driver = { 512 513 .name = "lineage_pem", 513 514 }, 514 - .probe = pem_probe, 515 + .probe_new = pem_probe, 515 516 .id_table = pem_id, 516 517 }; 517 518
+5 -4
drivers/hwmon/lm63.c
··· 1087 1087 (data->config_fan & 0x20) ? "manual" : "auto"); 1088 1088 } 1089 1089 1090 - static int lm63_probe(struct i2c_client *client, 1091 - const struct i2c_device_id *id) 1090 + static const struct i2c_device_id lm63_id[]; 1091 + 1092 + static int lm63_probe(struct i2c_client *client) 1092 1093 { 1093 1094 struct device *dev = &client->dev; 1094 1095 struct device *hwmon_dev; ··· 1107 1106 if (client->dev.of_node) 1108 1107 data->kind = (enum chips)of_device_get_match_data(&client->dev); 1109 1108 else 1110 - data->kind = id->driver_data; 1109 + data->kind = i2c_match_id(lm63_id, client)->driver_data; 1111 1110 if (data->kind == lm64) 1112 1111 data->temp2_offset = 16000; 1113 1112 ··· 1164 1163 .name = "lm63", 1165 1164 .of_match_table = of_match_ptr(lm63_of_match), 1166 1165 }, 1167 - .probe = lm63_probe, 1166 + .probe_new = lm63_probe, 1168 1167 .id_table = lm63_id, 1169 1168 .detect = lm63_detect, 1170 1169 .address_list = normal_i2c,
+5 -4
drivers/hwmon/lm75.c
··· 542 542 i2c_smbus_write_byte_data(client, LM75_REG_CONF, lm75->orig_conf); 543 543 } 544 544 545 - static int 546 - lm75_probe(struct i2c_client *client, const struct i2c_device_id *id) 545 + static const struct i2c_device_id lm75_ids[]; 546 + 547 + static int lm75_probe(struct i2c_client *client) 547 548 { 548 549 struct device *dev = &client->dev; 549 550 struct device *hwmon_dev; ··· 555 554 if (client->dev.of_node) 556 555 kind = (enum lm75_type)of_device_get_match_data(&client->dev); 557 556 else 558 - kind = id->driver_data; 557 + kind = i2c_match_id(lm75_ids, client)->driver_data; 559 558 560 559 if (!i2c_check_functionality(client->adapter, 561 560 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) ··· 894 893 .of_match_table = of_match_ptr(lm75_of_match), 895 894 .pm = LM75_DEV_PM_OPS, 896 895 }, 897 - .probe = lm75_probe, 896 + .probe_new = lm75_probe, 898 897 .id_table = lm75_ids, 899 898 .detect = lm75_detect, 900 899 .address_list = normal_i2c,
+2 -2
drivers/hwmon/lm77.c
··· 315 315 lm77_write_value(client, LM77_REG_CONF, conf & 0xfe); 316 316 } 317 317 318 - static int lm77_probe(struct i2c_client *client, const struct i2c_device_id *id) 318 + static int lm77_probe(struct i2c_client *client) 319 319 { 320 320 struct device *dev = &client->dev; 321 321 struct device *hwmon_dev; ··· 348 348 .driver = { 349 349 .name = "lm77", 350 350 }, 351 - .probe = lm77_probe, 351 + .probe_new = lm77_probe, 352 352 .id_table = lm77_id, 353 353 .detect = lm77_detect, 354 354 .address_list = normal_i2c,
+5 -4
drivers/hwmon/lm78.c
··· 627 627 return -ENODEV; 628 628 } 629 629 630 - static int lm78_i2c_probe(struct i2c_client *client, 631 - const struct i2c_device_id *id) 630 + static const struct i2c_device_id lm78_i2c_id[]; 631 + 632 + static int lm78_i2c_probe(struct i2c_client *client) 632 633 { 633 634 struct device *dev = &client->dev; 634 635 struct device *hwmon_dev; ··· 640 639 return -ENOMEM; 641 640 642 641 data->client = client; 643 - data->type = id->driver_data; 642 + data->type = i2c_match_id(lm78_i2c_id, client)->driver_data; 644 643 645 644 /* Initialize the LM78 chip */ 646 645 lm78_init_device(data); ··· 662 661 .driver = { 663 662 .name = "lm78", 664 663 }, 665 - .probe = lm78_i2c_probe, 664 + .probe_new = lm78_i2c_probe, 666 665 .id_table = lm78_i2c_id, 667 666 .detect = lm78_i2c_detect, 668 667 .address_list = normal_i2c,
+2 -3
drivers/hwmon/lm80.c
··· 591 591 return 0; 592 592 } 593 593 594 - static int lm80_probe(struct i2c_client *client, 595 - const struct i2c_device_id *id) 594 + static int lm80_probe(struct i2c_client *client) 596 595 { 597 596 struct device *dev = &client->dev; 598 597 struct device *hwmon_dev; ··· 640 641 .driver = { 641 642 .name = "lm80", 642 643 }, 643 - .probe = lm80_probe, 644 + .probe_new = lm80_probe, 644 645 .id_table = lm80_id, 645 646 .detect = lm80_detect, 646 647 .address_list = normal_i2c,
+5 -4
drivers/hwmon/lm83.c
··· 317 317 return 0; 318 318 } 319 319 320 - static int lm83_probe(struct i2c_client *new_client, 321 - const struct i2c_device_id *id) 320 + static const struct i2c_device_id lm83_id[]; 321 + 322 + static int lm83_probe(struct i2c_client *new_client) 322 323 { 323 324 struct device *hwmon_dev; 324 325 struct lm83_data *data; ··· 339 338 * declare 1 and 3 common, and then 2 and 4 only for the LM83. 340 339 */ 341 340 data->groups[0] = &lm83_group; 342 - if (id->driver_data == lm83) 341 + if (i2c_match_id(lm83_id, new_client)->driver_data == lm83) 343 342 data->groups[1] = &lm83_group_opt; 344 343 345 344 hwmon_dev = devm_hwmon_device_register_with_groups(&new_client->dev, ··· 364 363 .driver = { 365 364 .name = "lm83", 366 365 }, 367 - .probe = lm83_probe, 366 + .probe_new = lm83_probe, 368 367 .id_table = lm83_id, 369 368 .detect = lm83_detect, 370 369 .address_list = normal_i2c,
+5 -3
drivers/hwmon/lm85.c
··· 1544 1544 return 0; 1545 1545 } 1546 1546 1547 - static int lm85_probe(struct i2c_client *client, const struct i2c_device_id *id) 1547 + static const struct i2c_device_id lm85_id[]; 1548 + 1549 + static int lm85_probe(struct i2c_client *client) 1548 1550 { 1549 1551 struct device *dev = &client->dev; 1550 1552 struct device *hwmon_dev; ··· 1561 1559 if (client->dev.of_node) 1562 1560 data->type = (enum chips)of_device_get_match_data(&client->dev); 1563 1561 else 1564 - data->type = id->driver_data; 1562 + data->type = i2c_match_id(lm85_id, client)->driver_data; 1565 1563 mutex_init(&data->update_lock); 1566 1564 1567 1565 /* Fill in the chip specific driver values */ ··· 1698 1696 .name = "lm85", 1699 1697 .of_match_table = of_match_ptr(lm85_of_match), 1700 1698 }, 1701 - .probe = lm85_probe, 1699 + .probe_new = lm85_probe, 1702 1700 .id_table = lm85_id, 1703 1701 .detect = lm85_detect, 1704 1702 .address_list = normal_i2c,
+3 -4
drivers/hwmon/lm90.c
··· 1779 1779 .write = lm90_write, 1780 1780 }; 1781 1781 1782 - static int lm90_probe(struct i2c_client *client, 1783 - const struct i2c_device_id *id) 1782 + static int lm90_probe(struct i2c_client *client) 1784 1783 { 1785 1784 struct device *dev = &client->dev; 1786 1785 struct i2c_adapter *adapter = client->adapter; ··· 1815 1816 if (client->dev.of_node) 1816 1817 data->kind = (enum chips)of_device_get_match_data(&client->dev); 1817 1818 else 1818 - data->kind = id->driver_data; 1819 + data->kind = i2c_match_id(lm90_id, client)->driver_data; 1819 1820 if (data->kind == adm1032) { 1820 1821 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE)) 1821 1822 client->flags &= ~I2C_CLIENT_PEC; ··· 1951 1952 .name = "lm90", 1952 1953 .of_match_table = of_match_ptr(lm90_of_match), 1953 1954 }, 1954 - .probe = lm90_probe, 1955 + .probe_new = lm90_probe, 1955 1956 .alert = lm90_alert, 1956 1957 .id_table = lm90_id, 1957 1958 .detect = lm90_detect,
+2 -3
drivers/hwmon/lm92.c
··· 292 292 return 0; 293 293 } 294 294 295 - static int lm92_probe(struct i2c_client *new_client, 296 - const struct i2c_device_id *id) 295 + static int lm92_probe(struct i2c_client *new_client) 297 296 { 298 297 struct device *hwmon_dev; 299 298 struct lm92_data *data; ··· 330 331 .driver = { 331 332 .name = "lm92", 332 333 }, 333 - .probe = lm92_probe, 334 + .probe_new = lm92_probe, 334 335 .id_table = lm92_id, 335 336 .detect = lm92_detect, 336 337 .address_list = normal_i2c,
+2 -3
drivers/hwmon/lm93.c
··· 2583 2583 return 0; 2584 2584 } 2585 2585 2586 - static int lm93_probe(struct i2c_client *client, 2587 - const struct i2c_device_id *id) 2586 + static int lm93_probe(struct i2c_client *client) 2588 2587 { 2589 2588 struct device *dev = &client->dev; 2590 2589 struct lm93_data *data; ··· 2635 2636 .driver = { 2636 2637 .name = "lm93", 2637 2638 }, 2638 - .probe = lm93_probe, 2639 + .probe_new = lm93_probe, 2639 2640 .id_table = lm93_id, 2640 2641 .detect = lm93_detect, 2641 2642 .address_list = normal_i2c,
+5 -4
drivers/hwmon/lm95234.c
··· 677 677 return 0; 678 678 } 679 679 680 - static int lm95234_probe(struct i2c_client *client, 681 - const struct i2c_device_id *id) 680 + static const struct i2c_device_id lm95234_id[]; 681 + 682 + static int lm95234_probe(struct i2c_client *client) 682 683 { 683 684 struct device *dev = &client->dev; 684 685 struct lm95234_data *data; ··· 699 698 return err; 700 699 701 700 data->groups[0] = &lm95234_common_group; 702 - if (id->driver_data == lm95234) 701 + if (i2c_match_id(lm95234_id, client)->driver_data == lm95234) 703 702 data->groups[1] = &lm95234_group; 704 703 705 704 hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, ··· 720 719 .driver = { 721 720 .name = DRVNAME, 722 721 }, 723 - .probe = lm95234_probe, 722 + .probe_new = lm95234_probe, 724 723 .id_table = lm95234_id, 725 724 .detect = lm95234_detect, 726 725 .address_list = normal_i2c,
+2 -3
drivers/hwmon/lm95241.c
··· 432 432 .info = lm95241_info, 433 433 }; 434 434 435 - static int lm95241_probe(struct i2c_client *client, 436 - const struct i2c_device_id *id) 435 + static int lm95241_probe(struct i2c_client *client) 437 436 { 438 437 struct device *dev = &client->dev; 439 438 struct lm95241_data *data; ··· 468 469 .driver = { 469 470 .name = DEVNAME, 470 471 }, 471 - .probe = lm95241_probe, 472 + .probe_new = lm95241_probe, 472 473 .id_table = lm95241_id, 473 474 .detect = lm95241_detect, 474 475 .address_list = normal_i2c,
+2 -3
drivers/hwmon/lm95245.c
··· 547 547 .info = lm95245_info, 548 548 }; 549 549 550 - static int lm95245_probe(struct i2c_client *client, 551 - const struct i2c_device_id *id) 550 + static int lm95245_probe(struct i2c_client *client) 552 551 { 553 552 struct device *dev = &client->dev; 554 553 struct lm95245_data *data; ··· 597 598 .name = "lm95245", 598 599 .of_match_table = of_match_ptr(lm95245_of_match), 599 600 }, 600 - .probe = lm95245_probe, 601 + .probe_new = lm95245_probe, 601 602 .id_table = lm95245_id, 602 603 .detect = lm95245_detect, 603 604 .address_list = normal_i2c,
+2 -3
drivers/hwmon/ltc2945.c
··· 445 445 .max_register = LTC2945_MIN_ADIN_THRES_L, 446 446 }; 447 447 448 - static int ltc2945_probe(struct i2c_client *client, 449 - const struct i2c_device_id *id) 448 + static int ltc2945_probe(struct i2c_client *client) 450 449 { 451 450 struct device *dev = &client->dev; 452 451 struct device *hwmon_dev; ··· 477 478 .driver = { 478 479 .name = "ltc2945", 479 480 }, 480 - .probe = ltc2945_probe, 481 + .probe_new = ltc2945_probe, 481 482 .id_table = ltc2945_id, 482 483 }; 483 484
+2 -3
drivers/hwmon/ltc2990.c
··· 200 200 }; 201 201 __ATTRIBUTE_GROUPS(ltc2990); 202 202 203 - static int ltc2990_i2c_probe(struct i2c_client *i2c, 204 - const struct i2c_device_id *id) 203 + static int ltc2990_i2c_probe(struct i2c_client *i2c) 205 204 { 206 205 int ret; 207 206 struct device *hwmon_dev; ··· 268 269 .driver = { 269 270 .name = "ltc2990", 270 271 }, 271 - .probe = ltc2990_i2c_probe, 272 + .probe_new = ltc2990_i2c_probe, 272 273 .id_table = ltc2990_i2c_id, 273 274 }; 274 275
+2 -3
drivers/hwmon/ltc4151.c
··· 154 154 }; 155 155 ATTRIBUTE_GROUPS(ltc4151); 156 156 157 - static int ltc4151_probe(struct i2c_client *client, 158 - const struct i2c_device_id *id) 157 + static int ltc4151_probe(struct i2c_client *client) 159 158 { 160 159 struct i2c_adapter *adapter = client->adapter; 161 160 struct device *dev = &client->dev; ··· 205 206 .name = "ltc4151", 206 207 .of_match_table = of_match_ptr(ltc4151_match), 207 208 }, 208 - .probe = ltc4151_probe, 209 + .probe_new = ltc4151_probe, 209 210 .id_table = ltc4151_id, 210 211 }; 211 212
+2 -3
drivers/hwmon/ltc4215.c
··· 218 218 }; 219 219 ATTRIBUTE_GROUPS(ltc4215); 220 220 221 - static int ltc4215_probe(struct i2c_client *client, 222 - const struct i2c_device_id *id) 221 + static int ltc4215_probe(struct i2c_client *client) 223 222 { 224 223 struct i2c_adapter *adapter = client->adapter; 225 224 struct device *dev = &client->dev; ··· 255 256 .driver = { 256 257 .name = "ltc4215", 257 258 }, 258 - .probe = ltc4215_probe, 259 + .probe_new = ltc4215_probe, 259 260 .id_table = ltc4215_id, 260 261 }; 261 262
+2 -3
drivers/hwmon/ltc4222.c
··· 177 177 .max_register = LTC4222_ADC_CONTROL, 178 178 }; 179 179 180 - static int ltc4222_probe(struct i2c_client *client, 181 - const struct i2c_device_id *id) 180 + static int ltc4222_probe(struct i2c_client *client) 182 181 { 183 182 struct device *dev = &client->dev; 184 183 struct device *hwmon_dev; ··· 210 211 .driver = { 211 212 .name = "ltc4222", 212 213 }, 213 - .probe = ltc4222_probe, 214 + .probe_new = ltc4222_probe, 214 215 .id_table = ltc4222_id, 215 216 }; 216 217
+2 -3
drivers/hwmon/ltc4245.c
··· 440 440 return false; 441 441 } 442 442 443 - static int ltc4245_probe(struct i2c_client *client, 444 - const struct i2c_device_id *id) 443 + static int ltc4245_probe(struct i2c_client *client) 445 444 { 446 445 struct i2c_adapter *adapter = client->adapter; 447 446 struct ltc4245_data *data; ··· 479 480 .driver = { 480 481 .name = "ltc4245", 481 482 }, 482 - .probe = ltc4245_probe, 483 + .probe_new = ltc4245_probe, 483 484 .id_table = ltc4245_id, 484 485 }; 485 486
+2 -3
drivers/hwmon/ltc4260.c
··· 141 141 .max_register = LTC4260_ADIN, 142 142 }; 143 143 144 - static int ltc4260_probe(struct i2c_client *client, 145 - const struct i2c_device_id *id) 144 + static int ltc4260_probe(struct i2c_client *client) 146 145 { 147 146 struct device *dev = &client->dev; 148 147 struct device *hwmon_dev; ··· 173 174 .driver = { 174 175 .name = "ltc4260", 175 176 }, 176 - .probe = ltc4260_probe, 177 + .probe_new = ltc4260_probe, 177 178 .id_table = ltc4260_id, 178 179 }; 179 180
+2 -3
drivers/hwmon/ltc4261.c
··· 190 190 }; 191 191 ATTRIBUTE_GROUPS(ltc4261); 192 192 193 - static int ltc4261_probe(struct i2c_client *client, 194 - const struct i2c_device_id *id) 193 + static int ltc4261_probe(struct i2c_client *client) 195 194 { 196 195 struct i2c_adapter *adapter = client->adapter; 197 196 struct device *dev = &client->dev; ··· 233 234 .driver = { 234 235 .name = "ltc4261", 235 236 }, 236 - .probe = ltc4261_probe, 237 + .probe_new = ltc4261_probe, 237 238 .id_table = ltc4261_id, 238 239 }; 239 240
+5 -3
drivers/hwmon/max16065.c
··· 493 493 .is_visible = max16065_secondary_is_visible, 494 494 }; 495 495 496 - static int max16065_probe(struct i2c_client *client, 497 - const struct i2c_device_id *id) 496 + static const struct i2c_device_id max16065_id[]; 497 + 498 + static int max16065_probe(struct i2c_client *client) 498 499 { 499 500 struct i2c_adapter *adapter = client->adapter; 500 501 struct max16065_data *data; ··· 505 504 bool have_secondary; /* true if chip has secondary limits */ 506 505 bool secondary_is_max = false; /* secondary limits reflect max */ 507 506 int groups = 0; 507 + const struct i2c_device_id *id = i2c_match_id(max16065_id, client); 508 508 509 509 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA 510 510 | I2C_FUNC_SMBUS_READ_WORD_DATA)) ··· 600 598 .driver = { 601 599 .name = "max16065", 602 600 }, 603 - .probe = max16065_probe, 601 + .probe_new = max16065_probe, 604 602 .id_table = max16065_id, 605 603 }; 606 604
+2 -3
drivers/hwmon/max1619.c
··· 261 261 config & 0xBF); /* run */ 262 262 } 263 263 264 - static int max1619_probe(struct i2c_client *new_client, 265 - const struct i2c_device_id *id) 264 + static int max1619_probe(struct i2c_client *new_client) 266 265 { 267 266 struct max1619_data *data; 268 267 struct device *hwmon_dev; ··· 305 306 .name = "max1619", 306 307 .of_match_table = of_match_ptr(max1619_of_match), 307 308 }, 308 - .probe = max1619_probe, 309 + .probe_new = max1619_probe, 309 310 .id_table = max1619_id, 310 311 .detect = max1619_detect, 311 312 .address_list = normal_i2c,
+5 -4
drivers/hwmon/max1668.c
··· 391 391 return 0; 392 392 } 393 393 394 - static int max1668_probe(struct i2c_client *client, 395 - const struct i2c_device_id *id) 394 + static const struct i2c_device_id max1668_id[]; 395 + 396 + static int max1668_probe(struct i2c_client *client) 396 397 { 397 398 struct i2c_adapter *adapter = client->adapter; 398 399 struct device *dev = &client->dev; ··· 408 407 return -ENOMEM; 409 408 410 409 data->client = client; 411 - data->type = id->driver_data; 410 + data->type = i2c_match_id(max1668_id, client)->driver_data; 412 411 mutex_init(&data->update_lock); 413 412 414 413 /* sysfs hooks */ ··· 435 434 .driver = { 436 435 .name = "max1668", 437 436 }, 438 - .probe = max1668_probe, 437 + .probe_new = max1668_probe, 439 438 .id_table = max1668_id, 440 439 .detect = max1668_detect, 441 440 .address_list = max1668_addr_list,
+2 -2
drivers/hwmon/max31730.c
··· 292 292 } 293 293 294 294 static int 295 - max31730_probe(struct i2c_client *client, const struct i2c_device_id *id) 295 + max31730_probe(struct i2c_client *client) 296 296 { 297 297 struct device *dev = &client->dev; 298 298 struct device *hwmon_dev; ··· 427 427 .of_match_table = of_match_ptr(max31730_of_match), 428 428 .pm = &max31730_pm_ops, 429 429 }, 430 - .probe = max31730_probe, 430 + .probe_new = max31730_probe, 431 431 .id_table = max31730_ids, 432 432 .detect = max31730_detect, 433 433 .address_list = normal_i2c,
+2 -3
drivers/hwmon/max31790.c
··· 448 448 return 0; 449 449 } 450 450 451 - static int max31790_probe(struct i2c_client *client, 452 - const struct i2c_device_id *id) 451 + static int max31790_probe(struct i2c_client *client) 453 452 { 454 453 struct i2c_adapter *adapter = client->adapter; 455 454 struct device *dev = &client->dev; ··· 490 491 491 492 static struct i2c_driver max31790_driver = { 492 493 .class = I2C_CLASS_HWMON, 493 - .probe = max31790_probe, 494 + .probe_new = max31790_probe, 494 495 .driver = { 495 496 .name = "max31790", 496 497 },
+2 -3
drivers/hwmon/max6621.c
··· 477 477 .info = max6621_info, 478 478 }; 479 479 480 - static int max6621_probe(struct i2c_client *client, 481 - const struct i2c_device_id *id) 480 + static int max6621_probe(struct i2c_client *client) 482 481 { 483 482 struct device *dev = &client->dev; 484 483 struct max6621_data *data; ··· 554 555 .name = MAX6621_DRV_NAME, 555 556 .of_match_table = of_match_ptr(max6621_of_match), 556 557 }, 557 - .probe = max6621_probe, 558 + .probe_new = max6621_probe, 558 559 .id_table = max6621_id, 559 560 }; 560 561
+2 -3
drivers/hwmon/max6639.c
··· 516 516 return 0; 517 517 } 518 518 519 - static int max6639_probe(struct i2c_client *client, 520 - const struct i2c_device_id *id) 519 + static int max6639_probe(struct i2c_client *client) 521 520 { 522 521 struct device *dev = &client->dev; 523 522 struct max6639_data *data; ··· 580 581 .name = "max6639", 581 582 .pm = &max6639_pm_ops, 582 583 }, 583 - .probe = max6639_probe, 584 + .probe_new = max6639_probe, 584 585 .id_table = max6639_id, 585 586 .detect = max6639_detect, 586 587 .address_list = normal_i2c,
+2 -3
drivers/hwmon/max6642.c
··· 264 264 }; 265 265 ATTRIBUTE_GROUPS(max6642); 266 266 267 - static int max6642_probe(struct i2c_client *client, 268 - const struct i2c_device_id *id) 267 + static int max6642_probe(struct i2c_client *client) 269 268 { 270 269 struct device *dev = &client->dev; 271 270 struct max6642_data *data; ··· 301 302 .driver = { 302 303 .name = "max6642", 303 304 }, 304 - .probe = max6642_probe, 305 + .probe_new = max6642_probe, 305 306 .id_table = max6642_id, 306 307 .detect = max6642_detect, 307 308 .address_list = normal_i2c,
+6 -4
drivers/hwmon/max6650.c
··· 757 757 .info = max6650_info, 758 758 }; 759 759 760 - static int max6650_probe(struct i2c_client *client, 761 - const struct i2c_device_id *id) 760 + static const struct i2c_device_id max6650_id[]; 761 + 762 + static int max6650_probe(struct i2c_client *client) 762 763 { 763 764 struct thermal_cooling_device *cooling_dev; 764 765 struct device *dev = &client->dev; ··· 776 775 data->client = client; 777 776 i2c_set_clientdata(client, data); 778 777 mutex_init(&data->update_lock); 779 - data->nr_fans = of_id ? (int)(uintptr_t)of_id->data : id->driver_data; 778 + data->nr_fans = of_id ? (int)(uintptr_t)of_id->data : 779 + i2c_match_id(max6650_id, client)->driver_data; 780 780 781 781 /* 782 782 * Initialize the max6650 chip ··· 819 817 .name = "max6650", 820 818 .of_match_table = of_match_ptr(max6650_dt_match), 821 819 }, 822 - .probe = max6650_probe, 820 + .probe_new = max6650_probe, 823 821 .id_table = max6650_id, 824 822 }; 825 823
+5 -4
drivers/hwmon/max6697.c
··· 685 685 return 0; 686 686 } 687 687 688 - static int max6697_probe(struct i2c_client *client, 689 - const struct i2c_device_id *id) 688 + static const struct i2c_device_id max6697_id[]; 689 + 690 + static int max6697_probe(struct i2c_client *client) 690 691 { 691 692 struct i2c_adapter *adapter = client->adapter; 692 693 struct device *dev = &client->dev; ··· 705 704 if (client->dev.of_node) 706 705 data->type = (enum chips)of_device_get_match_data(&client->dev); 707 706 else 708 - data->type = id->driver_data; 707 + data->type = i2c_match_id(max6697_id, client)->driver_data; 709 708 data->chip = &max6697_chip_data[data->type]; 710 709 data->client = client; 711 710 mutex_init(&data->update_lock); ··· 786 785 .name = "max6697", 787 786 .of_match_table = of_match_ptr(max6697_of_match), 788 787 }, 789 - .probe = max6697_probe, 788 + .probe_new = max6697_probe, 790 789 .id_table = max6697_id, 791 790 }; 792 791
+5 -4
drivers/hwmon/mcp3021.c
··· 100 100 101 101 static DEVICE_ATTR_RO(in0_input); 102 102 103 - static int mcp3021_probe(struct i2c_client *client, 104 - const struct i2c_device_id *id) 103 + static const struct i2c_device_id mcp3021_id[]; 104 + 105 + static int mcp3021_probe(struct i2c_client *client) 105 106 { 106 107 int err; 107 108 struct mcp3021_data *data = NULL; ··· 133 132 data->vdd = MCP3021_VDD_REF_DEFAULT; 134 133 } 135 134 136 - switch (id->driver_data) { 135 + switch (i2c_match_id(mcp3021_id, client)->driver_data) { 137 136 case mcp3021: 138 137 data->sar_shift = MCP3021_SAR_SHIFT; 139 138 data->sar_mask = MCP3021_SAR_MASK; ··· 198 197 .name = "mcp3021", 199 198 .of_match_table = of_match_ptr(of_mcp3021_match), 200 199 }, 201 - .probe = mcp3021_probe, 200 + .probe_new = mcp3021_probe, 202 201 .remove = mcp3021_remove, 203 202 .id_table = mcp3021_id, 204 203 };
+2 -3
drivers/hwmon/nct7802.c
··· 1056 1056 return regmap_update_bits(data->regmap, REG_VMON_ENABLE, 0x03, 0x03); 1057 1057 } 1058 1058 1059 - static int nct7802_probe(struct i2c_client *client, 1060 - const struct i2c_device_id *id) 1059 + static int nct7802_probe(struct i2c_client *client) 1061 1060 { 1062 1061 struct device *dev = &client->dev; 1063 1062 struct nct7802_data *data; ··· 1100 1101 .name = DRVNAME, 1101 1102 }, 1102 1103 .detect = nct7802_detect, 1103 - .probe = nct7802_probe, 1104 + .probe_new = nct7802_probe, 1104 1105 .id_table = nct7802_idtable, 1105 1106 .address_list = nct7802_address_list, 1106 1107 };
+2 -3
drivers/hwmon/nct7904.c
··· 1009 1009 .get_timeleft = nct7904_wdt_get_timeleft, 1010 1010 }; 1011 1011 1012 - static int nct7904_probe(struct i2c_client *client, 1013 - const struct i2c_device_id *id) 1012 + static int nct7904_probe(struct i2c_client *client) 1014 1013 { 1015 1014 struct nct7904_data *data; 1016 1015 struct device *hwmon_dev; ··· 1171 1172 .driver = { 1172 1173 .name = "nct7904", 1173 1174 }, 1174 - .probe = nct7904_probe, 1175 + .probe_new = nct7904_probe, 1175 1176 .id_table = nct7904_id, 1176 1177 .detect = nct7904_detect, 1177 1178 .address_list = normal_i2c,
+2 -3
drivers/hwmon/occ/p8_i2c.c
··· 203 203 return 0; 204 204 } 205 205 206 - static int p8_i2c_occ_probe(struct i2c_client *client, 207 - const struct i2c_device_id *id) 206 + static int p8_i2c_occ_probe(struct i2c_client *client) 208 207 { 209 208 struct occ *occ; 210 209 struct p8_i2c_occ *ctx = devm_kzalloc(&client->dev, sizeof(*ctx), ··· 244 245 .name = "occ-hwmon", 245 246 .of_match_table = p8_i2c_occ_of_match, 246 247 }, 247 - .probe = p8_i2c_occ_probe, 248 + .probe_new = p8_i2c_occ_probe, 248 249 .remove = p8_i2c_occ_remove, 249 250 }; 250 251
+2 -3
drivers/hwmon/pcf8591.c
··· 179 179 * Real code 180 180 */ 181 181 182 - static int pcf8591_probe(struct i2c_client *client, 183 - const struct i2c_device_id *id) 182 + static int pcf8591_probe(struct i2c_client *client) 184 183 { 185 184 struct pcf8591_data *data; 186 185 int err; ··· 294 295 .driver = { 295 296 .name = "pcf8591", 296 297 }, 297 - .probe = pcf8591_probe, 298 + .probe_new = pcf8591_probe, 298 299 .remove = pcf8591_remove, 299 300 .id_table = pcf8591_id, 300 301 };
+2 -3
drivers/hwmon/powr1220.c
··· 297 297 298 298 ATTRIBUTE_GROUPS(powr1220); 299 299 300 - static int powr1220_probe(struct i2c_client *client, 301 - const struct i2c_device_id *id) 300 + static int powr1220_probe(struct i2c_client *client) 302 301 { 303 302 struct powr1220_data *data; 304 303 struct device *hwmon_dev; ··· 330 331 .driver = { 331 332 .name = "powr1220", 332 333 }, 333 - .probe = powr1220_probe, 334 + .probe_new = powr1220_probe, 334 335 .id_table = powr1220_ids, 335 336 }; 336 337
+2 -3
drivers/hwmon/sht21.c
··· 250 250 251 251 ATTRIBUTE_GROUPS(sht21); 252 252 253 - static int sht21_probe(struct i2c_client *client, 254 - const struct i2c_device_id *id) 253 + static int sht21_probe(struct i2c_client *client) 255 254 { 256 255 struct device *dev = &client->dev; 257 256 struct device *hwmon_dev; ··· 285 286 286 287 static struct i2c_driver sht21_driver = { 287 288 .driver.name = "sht21", 288 - .probe = sht21_probe, 289 + .probe_new = sht21_probe, 289 290 .id_table = sht21_id, 290 291 }; 291 292
+5 -4
drivers/hwmon/sht3x.c
··· 662 662 ATTRIBUTE_GROUPS(sht3x); 663 663 ATTRIBUTE_GROUPS(sts3x); 664 664 665 - static int sht3x_probe(struct i2c_client *client, 666 - const struct i2c_device_id *id) 665 + static const struct i2c_device_id sht3x_ids[]; 666 + 667 + static int sht3x_probe(struct i2c_client *client) 667 668 { 668 669 int ret; 669 670 struct sht3x_data *data; ··· 716 715 if (ret) 717 716 return ret; 718 717 719 - if (id->driver_data == sts3x) 718 + if (i2c_match_id(sht3x_ids, client)->driver_data == sts3x) 720 719 attribute_groups = sts3x_groups; 721 720 else 722 721 attribute_groups = sht3x_groups; ··· 743 742 744 743 static struct i2c_driver sht3x_i2c_driver = { 745 744 .driver.name = "sht3x", 746 - .probe = sht3x_probe, 745 + .probe_new = sht3x_probe, 747 746 .id_table = sht3x_ids, 748 747 }; 749 748
+5 -4
drivers/hwmon/shtc1.c
··· 185 185 } 186 186 } 187 187 188 - static int shtc1_probe(struct i2c_client *client, 189 - const struct i2c_device_id *id) 188 + static const struct i2c_device_id shtc1_id[]; 189 + 190 + static int shtc1_probe(struct i2c_client *client) 190 191 { 191 192 int ret; 192 193 u16 id_reg; 193 194 char id_reg_buf[2]; 194 195 struct shtc1_data *data; 195 196 struct device *hwmon_dev; 196 - enum shtcx_chips chip = id->driver_data; 197 + enum shtcx_chips chip = i2c_match_id(shtc1_id, client)->driver_data; 197 198 struct i2c_adapter *adap = client->adapter; 198 199 struct device *dev = &client->dev; 199 200 ··· 260 259 261 260 static struct i2c_driver shtc1_i2c_driver = { 262 261 .driver.name = "shtc1", 263 - .probe = shtc1_probe, 262 + .probe_new = shtc1_probe, 264 263 .id_table = shtc1_id, 265 264 }; 266 265
+5 -4
drivers/hwmon/smm665.c
··· 562 562 563 563 ATTRIBUTE_GROUPS(smm665); 564 564 565 - static int smm665_probe(struct i2c_client *client, 566 - const struct i2c_device_id *id) 565 + static const struct i2c_device_id smm665_id[]; 566 + 567 + static int smm665_probe(struct i2c_client *client) 567 568 { 568 569 struct i2c_adapter *adapter = client->adapter; 569 570 struct smm665_data *data; ··· 586 585 mutex_init(&data->update_lock); 587 586 588 587 data->client = client; 589 - data->type = id->driver_data; 588 + data->type = i2c_match_id(smm665_id, client)->driver_data; 590 589 data->cmdreg = i2c_new_dummy_device(adapter, (client->addr & ~SMM665_REGMASK) 591 590 | SMM665_CMDREG_BASE); 592 591 if (IS_ERR(data->cmdreg)) ··· 695 694 .driver = { 696 695 .name = "smm665", 697 696 }, 698 - .probe = smm665_probe, 697 + .probe_new = smm665_probe, 699 698 .remove = smm665_remove, 700 699 .id_table = smm665_id, 701 700 };
+2 -3
drivers/hwmon/smsc47m192.c
··· 587 587 return 0; 588 588 } 589 589 590 - static int smsc47m192_probe(struct i2c_client *client, 591 - const struct i2c_device_id *id) 590 + static int smsc47m192_probe(struct i2c_client *client) 592 591 { 593 592 struct device *dev = &client->dev; 594 593 struct device *hwmon_dev; ··· 628 629 .driver = { 629 630 .name = "smsc47m192", 630 631 }, 631 - .probe = smsc47m192_probe, 632 + .probe_new = smsc47m192_probe, 632 633 .id_table = smsc47m192_id, 633 634 .detect = smsc47m192_detect, 634 635 .address_list = normal_i2c,
+2 -3
drivers/hwmon/stts751.c
··· 762 762 }; 763 763 ATTRIBUTE_GROUPS(stts751); 764 764 765 - static int stts751_probe(struct i2c_client *client, 766 - const struct i2c_device_id *id) 765 + static int stts751_probe(struct i2c_client *client) 767 766 { 768 767 struct stts751_priv *priv; 769 768 int ret; ··· 821 822 .name = DEVNAME, 822 823 .of_match_table = of_match_ptr(stts751_of_match), 823 824 }, 824 - .probe = stts751_probe, 825 + .probe_new = stts751_probe, 825 826 .id_table = stts751_id, 826 827 .detect = stts751_detect, 827 828 .alert = stts751_alert,
+2 -3
drivers/hwmon/tc654.c
··· 446 446 * device probe and removal 447 447 */ 448 448 449 - static int tc654_probe(struct i2c_client *client, 450 - const struct i2c_device_id *id) 449 + static int tc654_probe(struct i2c_client *client) 451 450 { 452 451 struct device *dev = &client->dev; 453 452 struct tc654_data *data; ··· 487 488 .driver = { 488 489 .name = "tc654", 489 490 }, 490 - .probe = tc654_probe, 491 + .probe_new = tc654_probe, 491 492 .id_table = tc654_id, 492 493 }; 493 494
+2 -3
drivers/hwmon/tc74.c
··· 103 103 104 104 ATTRIBUTE_GROUPS(tc74); 105 105 106 - static int tc74_probe(struct i2c_client *client, 107 - const struct i2c_device_id *dev_id) 106 + static int tc74_probe(struct i2c_client *client) 108 107 { 109 108 struct device *dev = &client->dev; 110 109 struct tc74_data *data; ··· 160 161 .driver = { 161 162 .name = "tc74", 162 163 }, 163 - .probe = tc74_probe, 164 + .probe_new = tc74_probe, 164 165 .id_table = tc74_id, 165 166 }; 166 167
+5 -4
drivers/hwmon/thmc50.c
··· 377 377 i2c_smbus_write_byte_data(client, THMC50_REG_CONF, config); 378 378 } 379 379 380 - static int thmc50_probe(struct i2c_client *client, 381 - const struct i2c_device_id *id) 380 + static const struct i2c_device_id thmc50_id[]; 381 + 382 + static int thmc50_probe(struct i2c_client *client) 382 383 { 383 384 struct device *dev = &client->dev; 384 385 struct thmc50_data *data; ··· 391 390 return -ENOMEM; 392 391 393 392 data->client = client; 394 - data->type = id->driver_data; 393 + data->type = i2c_match_id(thmc50_id, client)->driver_data; 395 394 mutex_init(&data->update_lock); 396 395 397 396 thmc50_init_client(data); ··· 420 419 .driver = { 421 420 .name = "thmc50", 422 421 }, 423 - .probe = thmc50_probe, 422 + .probe_new = thmc50_probe, 424 423 .id_table = thmc50_id, 425 424 .detect = thmc50_detect, 426 425 .address_list = normal_i2c,
+2 -3
drivers/hwmon/tmp102.c
··· 189 189 .use_single_write = true, 190 190 }; 191 191 192 - static int tmp102_probe(struct i2c_client *client, 193 - const struct i2c_device_id *id) 192 + static int tmp102_probe(struct i2c_client *client) 194 193 { 195 194 struct device *dev = &client->dev; 196 195 struct device *hwmon_dev; ··· 303 304 .driver.name = DRIVER_NAME, 304 305 .driver.of_match_table = of_match_ptr(tmp102_of_match), 305 306 .driver.pm = &tmp102_dev_pm_ops, 306 - .probe = tmp102_probe, 307 + .probe_new = tmp102_probe, 307 308 .id_table = tmp102_id, 308 309 }; 309 310
+2 -3
drivers/hwmon/tmp103.c
··· 109 109 .volatile_reg = tmp103_regmap_is_volatile, 110 110 }; 111 111 112 - static int tmp103_probe(struct i2c_client *client, 113 - const struct i2c_device_id *id) 112 + static int tmp103_probe(struct i2c_client *client) 114 113 { 115 114 struct device *dev = &client->dev; 116 115 struct device *hwmon_dev; ··· 171 172 .of_match_table = of_match_ptr(tmp103_of_match), 172 173 .pm = &tmp103_dev_pm_ops, 173 174 }, 174 - .probe = tmp103_probe, 175 + .probe_new = tmp103_probe, 175 176 .id_table = tmp103_id, 176 177 }; 177 178
+2 -3
drivers/hwmon/tmp108.c
··· 323 323 .use_single_write = true, 324 324 }; 325 325 326 - static int tmp108_probe(struct i2c_client *client, 327 - const struct i2c_device_id *id) 326 + static int tmp108_probe(struct i2c_client *client) 328 327 { 329 328 struct device *dev = &client->dev; 330 329 struct device *hwmon_dev; ··· 432 433 .pm = &tmp108_dev_pm_ops, 433 434 .of_match_table = of_match_ptr(tmp108_of_ids), 434 435 }, 435 - .probe = tmp108_probe, 436 + .probe_new = tmp108_probe, 436 437 .id_table = tmp108_i2c_ids, 437 438 }; 438 439
+3 -4
drivers/hwmon/tmp401.c
··· 683 683 return 0; 684 684 } 685 685 686 - static int tmp401_probe(struct i2c_client *client, 687 - const struct i2c_device_id *id) 686 + static int tmp401_probe(struct i2c_client *client) 688 687 { 689 688 static const char * const names[] = { 690 689 "TMP401", "TMP411", "TMP431", "TMP432", "TMP435", "TMP461" ··· 699 700 700 701 data->client = client; 701 702 mutex_init(&data->update_lock); 702 - data->kind = id->driver_data; 703 + data->kind = i2c_match_id(tmp401_id, client)->driver_data; 703 704 704 705 /* Initialize the TMP401 chip */ 705 706 status = tmp401_init_client(data, client); ··· 735 736 .driver = { 736 737 .name = "tmp401", 737 738 }, 738 - .probe = tmp401_probe, 739 + .probe_new = tmp401_probe, 739 740 .id_table = tmp401_id, 740 741 .detect = tmp401_detect, 741 742 .address_list = normal_i2c,
+3 -4
drivers/hwmon/tmp421.c
··· 279 279 .read = tmp421_read, 280 280 }; 281 281 282 - static int tmp421_probe(struct i2c_client *client, 283 - const struct i2c_device_id *id) 282 + static int tmp421_probe(struct i2c_client *client) 284 283 { 285 284 struct device *dev = &client->dev; 286 285 struct device *hwmon_dev; ··· 295 296 data->channels = (unsigned long) 296 297 of_device_get_match_data(&client->dev); 297 298 else 298 - data->channels = id->driver_data; 299 + data->channels = i2c_match_id(tmp421_id, client)->driver_data; 299 300 data->client = client; 300 301 301 302 err = tmp421_init_client(client); ··· 326 327 .name = "tmp421", 327 328 .of_match_table = of_match_ptr(tmp421_of_match), 328 329 }, 329 - .probe = tmp421_probe, 330 + .probe_new = tmp421_probe, 330 331 .id_table = tmp421_id, 331 332 .detect = tmp421_detect, 332 333 .address_list = normal_i2c,
+2 -3
drivers/hwmon/w83773g.c
··· 259 259 .val_bits = 8, 260 260 }; 261 261 262 - static int w83773_probe(struct i2c_client *client, 263 - const struct i2c_device_id *id) 262 + static int w83773_probe(struct i2c_client *client) 264 263 { 265 264 struct device *dev = &client->dev; 266 265 struct device *hwmon_dev; ··· 295 296 .name = "w83773g", 296 297 .of_match_table = of_match_ptr(w83773_of_match), 297 298 }, 298 - .probe = w83773_probe, 299 + .probe_new = w83773_probe, 299 300 .id_table = w83773_id, 300 301 }; 301 302
+5 -4
drivers/hwmon/w83781d.c
··· 1192 1192 sysfs_remove_group(&dev->kobj, &w83781d_group_other); 1193 1193 } 1194 1194 1195 - static int 1196 - w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id) 1195 + static const struct i2c_device_id w83781d_ids[]; 1196 + 1197 + static int w83781d_probe(struct i2c_client *client) 1197 1198 { 1198 1199 struct device *dev = &client->dev; 1199 1200 struct w83781d_data *data; ··· 1208 1207 mutex_init(&data->lock); 1209 1208 mutex_init(&data->update_lock); 1210 1209 1211 - data->type = id->driver_data; 1210 + data->type = i2c_match_id(w83781d_ids, client)->driver_data; 1212 1211 data->client = client; 1213 1212 1214 1213 /* attach secondary i2c lm75-like clients */ ··· 1576 1575 .driver = { 1577 1576 .name = "w83781d", 1578 1577 }, 1579 - .probe = w83781d_probe, 1578 + .probe_new = w83781d_probe, 1580 1579 .remove = w83781d_remove, 1581 1580 .id_table = w83781d_ids, 1582 1581 .detect = w83781d_detect,
+3 -4
drivers/hwmon/w83792d.c
··· 286 286 u8 sf2_levels[3][4]; /* Smart FanII: Fan1,2,3 duty cycle levels */ 287 287 }; 288 288 289 - static int w83792d_probe(struct i2c_client *client, 290 - const struct i2c_device_id *id); 289 + static int w83792d_probe(struct i2c_client *client); 291 290 static int w83792d_detect(struct i2c_client *client, 292 291 struct i2c_board_info *info); 293 292 static int w83792d_remove(struct i2c_client *client); ··· 309 310 .driver = { 310 311 .name = "w83792d", 311 312 }, 312 - .probe = w83792d_probe, 313 + .probe_new = w83792d_probe, 313 314 .remove = w83792d_remove, 314 315 .id_table = w83792d_id, 315 316 .detect = w83792d_detect, ··· 1358 1359 } 1359 1360 1360 1361 static int 1361 - w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id) 1362 + w83792d_probe(struct i2c_client *client) 1362 1363 { 1363 1364 struct w83792d_data *data; 1364 1365 struct device *dev = &client->dev;
+3 -5
drivers/hwmon/w83l785ts.c
··· 62 62 * Functions declaration 63 63 */ 64 64 65 - static int w83l785ts_probe(struct i2c_client *client, 66 - const struct i2c_device_id *id); 65 + static int w83l785ts_probe(struct i2c_client *client); 67 66 static int w83l785ts_detect(struct i2c_client *client, 68 67 struct i2c_board_info *info); 69 68 static int w83l785ts_remove(struct i2c_client *client); ··· 84 85 .driver = { 85 86 .name = "w83l785ts", 86 87 }, 87 - .probe = w83l785ts_probe, 88 + .probe_new = w83l785ts_probe, 88 89 .remove = w83l785ts_remove, 89 90 .id_table = w83l785ts_id, 90 91 .detect = w83l785ts_detect, ··· 162 163 return 0; 163 164 } 164 165 165 - static int w83l785ts_probe(struct i2c_client *client, 166 - const struct i2c_device_id *id) 166 + static int w83l785ts_probe(struct i2c_client *client) 167 167 { 168 168 struct w83l785ts_data *data; 169 169 struct device *dev = &client->dev;
+2 -2
drivers/hwmon/w83l786ng.c
··· 706 706 } 707 707 708 708 static int 709 - w83l786ng_probe(struct i2c_client *client, const struct i2c_device_id *id) 709 + w83l786ng_probe(struct i2c_client *client) 710 710 { 711 711 struct device *dev = &client->dev; 712 712 struct w83l786ng_data *data; ··· 752 752 .driver = { 753 753 .name = "w83l786ng", 754 754 }, 755 - .probe = w83l786ng_probe, 755 + .probe_new = w83l786ng_probe, 756 756 .id_table = w83l786ng_id, 757 757 .detect = w83l786ng_detect, 758 758 .address_list = normal_i2c,