From: WANG Cong <xiyou.wangcong@gmail.com> To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, WANG Cong <xiyou.wangcong@gmail.com>, Jean Delvare <khali@linux-fr.org>, Randy Dunlap <rdunlap@xenotime.net>, "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [PATCH] i2c: remove deprecated callbacks Date: Thu, 1 Sep 2011 12:40:27 +0800 [thread overview] Message-ID: <1314852027-9523-1-git-send-email-xiyou.wangcong@gmail.com> (raw) i2c_driver.attach_adapter and i2c_driver.detach_adapter are deprecated and scheduled to be removed in Sep 2011. Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> --- 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@linux-fr.org> - ----------------------------- - 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 *);
WARNING: multiple messages have this Message-ID (diff)
From: WANG Cong <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, WANG Cong <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>, Randy Dunlap <rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>, "Ben Dooks (embedded platforms)" <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: [PATCH] i2c: remove deprecated callbacks Date: Thu, 1 Sep 2011 12:40:27 +0800 [thread overview] Message-ID: <1314852027-9523-1-git-send-email-xiyou.wangcong@gmail.com> (raw) i2c_driver.attach_adapter and i2c_driver.detach_adapter are deprecated and scheduled to be removed in Sep 2011. Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> Signed-off-by: WANG Cong <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> --- 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-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> - ----------------------------- - 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 *);
next reply other threads:[~2011-09-01 4:41 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-09-01 4:40 WANG Cong [this message] 2011-09-01 4:40 ` [PATCH] i2c: remove deprecated callbacks WANG Cong 2011-09-01 8:52 ` Jean Delvare 2011-09-01 9:12 ` Américo Wang 2011-09-01 13:01 ` Jean Delvare 2011-09-01 23:24 ` Benjamin Herrenschmidt 2011-09-01 23:32 ` Benjamin Herrenschmidt 2011-09-01 23:32 ` Benjamin Herrenschmidt 2011-09-02 6:28 ` Jean Delvare 2011-09-02 20:15 ` Benjamin Herrenschmidt 2011-09-02 20:15 ` Benjamin Herrenschmidt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1314852027-9523-1-git-send-email-xiyou.wangcong@gmail.com \ --to=xiyou.wangcong@gmail.com \ --cc=akpm@linux-foundation.org \ --cc=ben-linux@fluff.org \ --cc=khali@linux-fr.org \ --cc=linux-doc@vger.kernel.org \ --cc=linux-i2c@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=rdunlap@xenotime.net \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.