i2c_driver.attach_adapter and i2c_driver.detach_adapter are deprecated and scheduled to be removed in Sep 2011. Cc: Jean Delvare <khali@xxxxxxxxxxxx> Signed-off-by: WANG Cong <xiyou.wangcong@xxxxxxxxx> --- diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index c4a6e14..89a9695 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -486,15 +486,6 @@ Files: include/linux/netfilter_ipv4/ipt_addrtype.h ---------------------------- -What: i2c_driver.attach_adapter - i2c_driver.detach_adapter -When: September 2011 -Why: These legacy callbacks should no longer be used as i2c-core offers - a variety of preferable alternative ways to instantiate I2C devices. -Who: Jean Delvare <khali@xxxxxxxxxxxx> - ----------------------------- - What: Support for UVCIOC_CTRL_ADD in the uvcvideo driver When: 3.2 Why: The information passed to the driver by this ioctl is now queried diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 131079a..c833c53 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -44,8 +44,8 @@ /* core_lock protects i2c_adapter_idr, and guarantees - that device detection, deletion of detected devices, and attach_adapter - and detach_adapter calls are serialized */ + that device detection, deletion of detected devices + calls are serialized */ static DEFINE_MUTEX(core_lock); static DEFINE_IDR(i2c_adapter_idr); @@ -795,15 +795,6 @@ static int i2c_do_add_adapter(struct i2c_driver *driver, /* Detect supported devices on that bus, and instantiate them */ i2c_detect(adap, driver); - /* Let legacy drivers scan this bus for matching devices */ - if (driver->attach_adapter) { - dev_warn(&adap->dev, "%s: attach_adapter method is deprecated\n", - driver->driver.name); - dev_warn(&adap->dev, "Please use another way to instantiate " - "your i2c_client\n"); - /* We ignore the return code; if it fails, too bad */ - driver->attach_adapter(adap); - } return 0; } @@ -975,7 +966,6 @@ static int i2c_do_del_adapter(struct i2c_driver *driver, struct i2c_adapter *adapter) { struct i2c_client *client, *_n; - int res; /* Remove the devices we created ourselves as the result of hardware * probing (using a driver's detect method) */ @@ -988,15 +978,7 @@ static int i2c_do_del_adapter(struct i2c_driver *driver, } } - if (!driver->detach_adapter) - return 0; - dev_warn(&adapter->dev, "%s: detach_adapter method is deprecated\n", - driver->driver.name); - res = driver->detach_adapter(adapter); - if (res) - dev_err(&adapter->dev, "detach_adapter failed (%d) " - "for driver [%s]\n", res, driver->driver.name); - return res; + return 0; } static int __unregister_client(struct device *dev, void *dummy) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a6c652e..25c2c87 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -142,13 +142,6 @@ extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, struct i2c_driver { unsigned int class; - /* Notifies the driver that a new bus has appeared or is about to be - * removed. You should avoid using this, it will be removed in a - * near future. - */ - int (*attach_adapter)(struct i2c_adapter *) __deprecated; - int (*detach_adapter)(struct i2c_adapter *) __deprecated; - /* Standard driver model interfaces */ int (*probe)(struct i2c_client *, const struct i2c_device_id *); int (*remove)(struct i2c_client *); -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html