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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'i2c-for-6.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c updates from Wolfram Sang:
"This marks the end of a transition to let I2C have the same probe
semantics as other subsystems. Uwe took care that no drivers in the
current tree nor in -next use the deprecated .probe call. So, it is a
good time to switch to the new, standard semantics now.

There is also a regression fix:

- regression fix for the notifier handling of the I2C core

- final coversions of drivers away from deprecated .probe

- make .probe_new the standard probe and convert I2C core to use it

* tag 'i2c-for-6.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: dev: Fix bus callback return values
i2c: Convert drivers to new .probe() callback
i2c: mux: Convert all drivers to new .probe() callback
i2c: Switch .probe() to not take an id parameter
media: i2c: ov2685: convert to i2c's .probe_new()
media: i2c: ov5695: convert to i2c's .probe_new()
w1: ds2482: Convert to i2c's .probe_new()
serial: sc16is7xx: Convert to i2c's .probe_new()
mtd: maps: pismo: Convert to i2c's .probe_new()
misc: ad525x_dpot-i2c: Convert to i2c's .probe_new()

+52 -47
+3 -10
drivers/i2c/i2c-core-base.c
··· 561 561 goto err_detach_pm_domain; 562 562 } 563 563 564 - /* 565 - * When there are no more users of probe(), 566 - * rename probe_new to probe. 567 - */ 568 - if (driver->probe_new) 569 - status = driver->probe_new(client); 570 - else if (driver->probe) 571 - status = driver->probe(client, 572 - i2c_match_id(driver->id_table, client)); 564 + if (driver->probe) 565 + status = driver->probe(client); 573 566 else 574 567 status = -EINVAL; 575 568 ··· 1050 1057 1051 1058 static struct i2c_driver dummy_driver = { 1052 1059 .driver.name = "dummy", 1053 - .probe_new = dummy_probe, 1060 + .probe = dummy_probe, 1054 1061 .id_table = dummy_id, 1055 1062 }; 1056 1063
+18 -6
drivers/i2c/i2c-dev.c
··· 646 646 kfree(i2c_dev); 647 647 } 648 648 649 - static int i2cdev_attach_adapter(struct device *dev, void *dummy) 649 + static int i2cdev_attach_adapter(struct device *dev) 650 650 { 651 651 struct i2c_adapter *adap; 652 652 struct i2c_dev *i2c_dev; ··· 685 685 return NOTIFY_DONE; 686 686 } 687 687 688 - static int i2cdev_detach_adapter(struct device *dev, void *dummy) 688 + static int i2cdev_detach_adapter(struct device *dev) 689 689 { 690 690 struct i2c_adapter *adap; 691 691 struct i2c_dev *i2c_dev; ··· 711 711 712 712 switch (action) { 713 713 case BUS_NOTIFY_ADD_DEVICE: 714 - return i2cdev_attach_adapter(dev, NULL); 714 + return i2cdev_attach_adapter(dev); 715 715 case BUS_NOTIFY_DEL_DEVICE: 716 - return i2cdev_detach_adapter(dev, NULL); 716 + return i2cdev_detach_adapter(dev); 717 717 } 718 718 719 719 return NOTIFY_DONE; ··· 724 724 }; 725 725 726 726 /* ------------------------------------------------------------------------- */ 727 + 728 + static int __init i2c_dev_attach_adapter(struct device *dev, void *dummy) 729 + { 730 + i2cdev_attach_adapter(dev); 731 + return 0; 732 + } 733 + 734 + static int __exit i2c_dev_detach_adapter(struct device *dev, void *dummy) 735 + { 736 + i2cdev_detach_adapter(dev); 737 + return 0; 738 + } 727 739 728 740 /* 729 741 * module load/unload record keeping ··· 764 752 goto out_unreg_class; 765 753 766 754 /* Bind to already existing adapters right away */ 767 - i2c_for_each_dev(NULL, i2cdev_attach_adapter); 755 + i2c_for_each_dev(NULL, i2c_dev_attach_adapter); 768 756 769 757 return 0; 770 758 ··· 780 768 static void __exit i2c_dev_exit(void) 781 769 { 782 770 bus_unregister_notifier(&i2c_bus_type, &i2cdev_notifier); 783 - i2c_for_each_dev(NULL, i2cdev_detach_adapter); 771 + i2c_for_each_dev(NULL, i2c_dev_detach_adapter); 784 772 class_destroy(i2c_dev_class); 785 773 unregister_chrdev_region(MKDEV(I2C_MAJOR, 0), I2C_MINORS); 786 774 }
+1 -1
drivers/i2c/i2c-slave-eeprom.c
··· 207 207 .driver = { 208 208 .name = "i2c-slave-eeprom", 209 209 }, 210 - .probe_new = i2c_slave_eeprom_probe, 210 + .probe = i2c_slave_eeprom_probe, 211 211 .remove = i2c_slave_eeprom_remove, 212 212 .id_table = i2c_slave_eeprom_id, 213 213 };
+1 -1
drivers/i2c/i2c-slave-testunit.c
··· 171 171 .driver = { 172 172 .name = "i2c-slave-testunit", 173 173 }, 174 - .probe_new = i2c_slave_testunit_probe, 174 + .probe = i2c_slave_testunit_probe, 175 175 .remove = i2c_slave_testunit_remove, 176 176 .id_table = i2c_slave_testunit_id, 177 177 };
+1 -1
drivers/i2c/i2c-smbus.c
··· 169 169 .driver = { 170 170 .name = "smbus_alert", 171 171 }, 172 - .probe_new = smbalert_probe, 172 + .probe = smbalert_probe, 173 173 .remove = smbalert_remove, 174 174 .id_table = smbalert_ids, 175 175 };
+1 -1
drivers/i2c/muxes/i2c-mux-ltc4306.c
··· 306 306 .name = "ltc4306", 307 307 .of_match_table = of_match_ptr(ltc4306_of_match), 308 308 }, 309 - .probe_new = ltc4306_probe, 309 + .probe = ltc4306_probe, 310 310 .remove = ltc4306_remove, 311 311 .id_table = ltc4306_id, 312 312 };
+1 -1
drivers/i2c/muxes/i2c-mux-pca9541.c
··· 336 336 .name = "pca9541", 337 337 .of_match_table = of_match_ptr(pca9541_of_match), 338 338 }, 339 - .probe_new = pca9541_probe, 339 + .probe = pca9541_probe, 340 340 .remove = pca9541_remove, 341 341 .id_table = pca9541_id, 342 342 };
+1 -1
drivers/i2c/muxes/i2c-mux-pca954x.c
··· 554 554 .pm = &pca954x_pm, 555 555 .of_match_table = pca954x_of_match, 556 556 }, 557 - .probe_new = pca954x_probe, 557 + .probe = pca954x_probe, 558 558 .remove = pca954x_remove, 559 559 .id_table = pca954x_id, 560 560 };
+2 -3
drivers/media/i2c/ov2685.c
··· 707 707 ov2685->supplies); 708 708 } 709 709 710 - static int ov2685_probe(struct i2c_client *client, 711 - const struct i2c_device_id *id) 710 + static int ov2685_probe(struct i2c_client *client) 712 711 { 713 712 struct device *dev = &client->dev; 714 713 struct ov2685 *ov2685; ··· 829 830 .pm = &ov2685_pm_ops, 830 831 .of_match_table = of_match_ptr(ov2685_of_match), 831 832 }, 832 - .probe = &ov2685_probe, 833 + .probe_new = &ov2685_probe, 833 834 .remove = &ov2685_remove, 834 835 }; 835 836
+2 -3
drivers/media/i2c/ov5695.c
··· 1267 1267 ov5695->supplies); 1268 1268 } 1269 1269 1270 - static int ov5695_probe(struct i2c_client *client, 1271 - const struct i2c_device_id *id) 1270 + static int ov5695_probe(struct i2c_client *client) 1272 1271 { 1273 1272 struct device *dev = &client->dev; 1274 1273 struct ov5695 *ov5695; ··· 1392 1393 .pm = &ov5695_pm_ops, 1393 1394 .of_match_table = of_match_ptr(ov5695_of_match), 1394 1395 }, 1395 - .probe = &ov5695_probe, 1396 + .probe_new = &ov5695_probe, 1396 1397 .remove = &ov5695_remove, 1397 1398 }; 1398 1399
+3 -3
drivers/misc/ad525x_dpot-i2c.c
··· 50 50 .write_r8d16 = write_r8d16, 51 51 }; 52 52 53 - static int ad_dpot_i2c_probe(struct i2c_client *client, 54 - const struct i2c_device_id *id) 53 + static int ad_dpot_i2c_probe(struct i2c_client *client) 55 54 { 55 + const struct i2c_device_id *id = i2c_client_get_device_id(client); 56 56 struct ad_dpot_bus_data bdata = { 57 57 .client = client, 58 58 .bops = &bops, ··· 106 106 .driver = { 107 107 .name = "ad_dpot", 108 108 }, 109 - .probe = ad_dpot_i2c_probe, 109 + .probe_new = ad_dpot_i2c_probe, 110 110 .remove = ad_dpot_i2c_remove, 111 111 .id_table = ad_dpot_id, 112 112 };
+2 -3
drivers/mtd/maps/pismo.c
··· 206 206 kfree(pismo); 207 207 } 208 208 209 - static int pismo_probe(struct i2c_client *client, 210 - const struct i2c_device_id *id) 209 + static int pismo_probe(struct i2c_client *client) 211 210 { 212 211 struct pismo_pdata *pdata = client->dev.platform_data; 213 212 struct pismo_eeprom eeprom; ··· 259 260 .driver = { 260 261 .name = "pismo", 261 262 }, 262 - .probe = pismo_probe, 263 + .probe_new = pismo_probe, 263 264 .remove = pismo_remove, 264 265 .id_table = pismo_id, 265 266 };
+3 -3
drivers/tty/serial/sc16is7xx.c
··· 1666 1666 #endif 1667 1667 1668 1668 #ifdef CONFIG_SERIAL_SC16IS7XX_I2C 1669 - static int sc16is7xx_i2c_probe(struct i2c_client *i2c, 1670 - const struct i2c_device_id *id) 1669 + static int sc16is7xx_i2c_probe(struct i2c_client *i2c) 1671 1670 { 1671 + const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 1672 1672 const struct sc16is7xx_devtype *devtype; 1673 1673 struct regmap *regmap; 1674 1674 ··· 1709 1709 .name = SC16IS7XX_NAME, 1710 1710 .of_match_table = sc16is7xx_dt_ids, 1711 1711 }, 1712 - .probe = sc16is7xx_i2c_probe, 1712 + .probe_new = sc16is7xx_i2c_probe, 1713 1713 .remove = sc16is7xx_i2c_remove, 1714 1714 .id_table = sc16is7xx_i2c_id_table, 1715 1715 };
+2 -3
drivers/w1/masters/ds2482.c
··· 442 442 } 443 443 444 444 445 - static int ds2482_probe(struct i2c_client *client, 446 - const struct i2c_device_id *id) 445 + static int ds2482_probe(struct i2c_client *client) 447 446 { 448 447 struct ds2482_data *data; 449 448 int err = -ENODEV; ··· 552 553 .driver = { 553 554 .name = "ds2482", 554 555 }, 555 - .probe = ds2482_probe, 556 + .probe_new = ds2482_probe, 556 557 .remove = ds2482_remove, 557 558 .id_table = ds2482_id, 558 559 };
+11 -7
include/linux/i2c.h
··· 236 236 /** 237 237 * struct i2c_driver - represent an I2C device driver 238 238 * @class: What kind of i2c device we instantiate (for detect) 239 - * @probe: Callback for device binding - soon to be deprecated 240 - * @probe_new: New callback for device binding 239 + * @probe: Callback for device binding 240 + * @probe_new: Transitional callback for device binding - do not use 241 241 * @remove: Callback for device unbinding 242 242 * @shutdown: Callback for device shutdown 243 243 * @alert: Alert callback, for example for the SMBus alert protocol ··· 272 272 struct i2c_driver { 273 273 unsigned int class; 274 274 275 + union { 275 276 /* Standard driver model interfaces */ 276 - int (*probe)(struct i2c_client *client, const struct i2c_device_id *id); 277 + int (*probe)(struct i2c_client *client); 278 + /* 279 + * Legacy callback that was part of a conversion of .probe(). 280 + * Today it has the same semantic as .probe(). Don't use for new 281 + * code. 282 + */ 283 + int (*probe_new)(struct i2c_client *client); 284 + }; 277 285 void (*remove)(struct i2c_client *client); 278 286 279 - /* New driver model interface to aid the seamless removal of the 280 - * current probe()'s, more commonly unused than used second parameter. 281 - */ 282 - int (*probe_new)(struct i2c_client *client); 283 287 284 288 /* driver model interfaces that don't relate to enumeration */ 285 289 void (*shutdown)(struct i2c_client *client);