Skip to content

Commit 81ff855

Browse files
committed
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()
2 parents e25c54d + 9e5f81f commit 81ff855

File tree

15 files changed

+52
-47
lines changed

15 files changed

+52
-47
lines changed

drivers/i2c/i2c-core-base.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -561,15 +561,8 @@ static int i2c_device_probe(struct device *dev)
561561
goto err_detach_pm_domain;
562562
}
563563

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);
573566
else
574567
status = -EINVAL;
575568

@@ -1057,7 +1050,7 @@ static int dummy_probe(struct i2c_client *client)
10571050

10581051
static struct i2c_driver dummy_driver = {
10591052
.driver.name = "dummy",
1060-
.probe_new = dummy_probe,
1053+
.probe = dummy_probe,
10611054
.id_table = dummy_id,
10621055
};
10631056

drivers/i2c/i2c-dev.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ static void i2cdev_dev_release(struct device *dev)
646646
kfree(i2c_dev);
647647
}
648648

649-
static int i2cdev_attach_adapter(struct device *dev, void *dummy)
649+
static int i2cdev_attach_adapter(struct device *dev)
650650
{
651651
struct i2c_adapter *adap;
652652
struct i2c_dev *i2c_dev;
@@ -685,7 +685,7 @@ static int i2cdev_attach_adapter(struct device *dev, void *dummy)
685685
return NOTIFY_DONE;
686686
}
687687

688-
static int i2cdev_detach_adapter(struct device *dev, void *dummy)
688+
static int i2cdev_detach_adapter(struct device *dev)
689689
{
690690
struct i2c_adapter *adap;
691691
struct i2c_dev *i2c_dev;
@@ -711,9 +711,9 @@ static int i2cdev_notifier_call(struct notifier_block *nb, unsigned long action,
711711

712712
switch (action) {
713713
case BUS_NOTIFY_ADD_DEVICE:
714-
return i2cdev_attach_adapter(dev, NULL);
714+
return i2cdev_attach_adapter(dev);
715715
case BUS_NOTIFY_DEL_DEVICE:
716-
return i2cdev_detach_adapter(dev, NULL);
716+
return i2cdev_detach_adapter(dev);
717717
}
718718

719719
return NOTIFY_DONE;
@@ -725,6 +725,18 @@ static struct notifier_block i2cdev_notifier = {
725725

726726
/* ------------------------------------------------------------------------- */
727727

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+
}
739+
728740
/*
729741
* module load/unload record keeping
730742
*/
@@ -752,7 +764,7 @@ static int __init i2c_dev_init(void)
752764
goto out_unreg_class;
753765

754766
/* Bind to already existing adapters right away */
755-
i2c_for_each_dev(NULL, i2cdev_attach_adapter);
767+
i2c_for_each_dev(NULL, i2c_dev_attach_adapter);
756768

757769
return 0;
758770

@@ -768,7 +780,7 @@ static int __init i2c_dev_init(void)
768780
static void __exit i2c_dev_exit(void)
769781
{
770782
bus_unregister_notifier(&i2c_bus_type, &i2cdev_notifier);
771-
i2c_for_each_dev(NULL, i2cdev_detach_adapter);
783+
i2c_for_each_dev(NULL, i2c_dev_detach_adapter);
772784
class_destroy(i2c_dev_class);
773785
unregister_chrdev_region(MKDEV(I2C_MAJOR, 0), I2C_MINORS);
774786
}

drivers/i2c/i2c-slave-eeprom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static struct i2c_driver i2c_slave_eeprom_driver = {
207207
.driver = {
208208
.name = "i2c-slave-eeprom",
209209
},
210-
.probe_new = i2c_slave_eeprom_probe,
210+
.probe = i2c_slave_eeprom_probe,
211211
.remove = i2c_slave_eeprom_remove,
212212
.id_table = i2c_slave_eeprom_id,
213213
};

drivers/i2c/i2c-slave-testunit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static struct i2c_driver i2c_slave_testunit_driver = {
171171
.driver = {
172172
.name = "i2c-slave-testunit",
173173
},
174-
.probe_new = i2c_slave_testunit_probe,
174+
.probe = i2c_slave_testunit_probe,
175175
.remove = i2c_slave_testunit_remove,
176176
.id_table = i2c_slave_testunit_id,
177177
};

drivers/i2c/i2c-smbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static struct i2c_driver smbalert_driver = {
169169
.driver = {
170170
.name = "smbus_alert",
171171
},
172-
.probe_new = smbalert_probe,
172+
.probe = smbalert_probe,
173173
.remove = smbalert_remove,
174174
.id_table = smbalert_ids,
175175
};

drivers/i2c/muxes/i2c-mux-ltc4306.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static struct i2c_driver ltc4306_driver = {
306306
.name = "ltc4306",
307307
.of_match_table = of_match_ptr(ltc4306_of_match),
308308
},
309-
.probe_new = ltc4306_probe,
309+
.probe = ltc4306_probe,
310310
.remove = ltc4306_remove,
311311
.id_table = ltc4306_id,
312312
};

drivers/i2c/muxes/i2c-mux-pca9541.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static struct i2c_driver pca9541_driver = {
336336
.name = "pca9541",
337337
.of_match_table = of_match_ptr(pca9541_of_match),
338338
},
339-
.probe_new = pca9541_probe,
339+
.probe = pca9541_probe,
340340
.remove = pca9541_remove,
341341
.id_table = pca9541_id,
342342
};

drivers/i2c/muxes/i2c-mux-pca954x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static struct i2c_driver pca954x_driver = {
554554
.pm = &pca954x_pm,
555555
.of_match_table = pca954x_of_match,
556556
},
557-
.probe_new = pca954x_probe,
557+
.probe = pca954x_probe,
558558
.remove = pca954x_remove,
559559
.id_table = pca954x_id,
560560
};

drivers/media/i2c/ov2685.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,7 @@ static int ov2685_configure_regulators(struct ov2685 *ov2685)
707707
ov2685->supplies);
708708
}
709709

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)
712711
{
713712
struct device *dev = &client->dev;
714713
struct ov2685 *ov2685;
@@ -830,7 +829,7 @@ static struct i2c_driver ov2685_i2c_driver = {
830829
.pm = &ov2685_pm_ops,
831830
.of_match_table = of_match_ptr(ov2685_of_match),
832831
},
833-
.probe = &ov2685_probe,
832+
.probe_new = &ov2685_probe,
834833
.remove = &ov2685_remove,
835834
};
836835

drivers/media/i2c/ov5695.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,8 +1267,7 @@ static int ov5695_configure_regulators(struct ov5695 *ov5695)
12671267
ov5695->supplies);
12681268
}
12691269

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)
12721271
{
12731272
struct device *dev = &client->dev;
12741273
struct ov5695 *ov5695;
@@ -1393,7 +1392,7 @@ static struct i2c_driver ov5695_i2c_driver = {
13931392
.pm = &ov5695_pm_ops,
13941393
.of_match_table = of_match_ptr(ov5695_of_match),
13951394
},
1396-
.probe = &ov5695_probe,
1395+
.probe_new = &ov5695_probe,
13971396
.remove = &ov5695_remove,
13981397
};
13991398

0 commit comments

Comments
 (0)