* [PATCH] i2c: Warn on deprecated binding model use
@ 2009-01-13 13:40 Jean Delvare
[not found] ` <20090113144044.5b6fb53a-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2009-01-13 13:40 UTC (permalink / raw)
To: Linux I2C
Let the kernel developers know that i2c_attach_client() and
i2c_detach_client() are deprecated and should no longer be used.
Drivers using these should be converted to the standard device
driver binding model (probe and remove methods.)
Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
---
This is only for linux-next for now, in the hope that it will speed up
the conversion of the remaining legacy i2c drivers.
include/linux/i2c.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- linux-2.6.29-rc1.orig/include/linux/i2c.h 2009-01-12 18:43:41.000000000 +0100
+++ linux-2.6.29-rc1/include/linux/i2c.h 2009-01-13 14:37:27.000000000 +0100
@@ -151,7 +151,7 @@ struct i2c_driver {
* has been dynamically allocated by the driver in the function above,
* it must be freed here. (LEGACY I2C DRIVERS ONLY)
*/
- int (*detach_client)(struct i2c_client *);
+ int (*detach_client)(struct i2c_client *) __deprecated;
/* Standard driver model interfaces, for "new style" i2c drivers.
* With the driver model, device enumeration is NEVER done by drivers;
@@ -429,8 +429,10 @@ static inline int i2c_add_driver(struct
return i2c_register_driver(THIS_MODULE, driver);
}
-extern int i2c_attach_client(struct i2c_client *);
-extern int i2c_detach_client(struct i2c_client *);
+/* These are deprecated, your driver should use the standard .probe()
+ * and .remove() methods instead. */
+extern int __deprecated i2c_attach_client(struct i2c_client *);
+extern int __deprecated i2c_detach_client(struct i2c_client *);
extern struct i2c_client *i2c_use_client(struct i2c_client *client);
extern void i2c_release_client(struct i2c_client *client);
--
Jean Delvare
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: Warn on deprecated binding model use
[not found] ` <20090113144044.5b6fb53a-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2009-01-13 15:44 ` Ben Dooks
[not found] ` <20090113154428.GK8032-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2009-01-13 15:44 UTC (permalink / raw)
To: Jean Delvare; +Cc: Linux I2C
On Tue, Jan 13, 2009 at 02:40:44PM +0100, Jean Delvare wrote:
> Let the kernel developers know that i2c_attach_client() and
> i2c_detach_client() are deprecated and should no longer be used.
> Drivers using these should be converted to the standard device
> driver binding model (probe and remove methods.)
>
> Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
This is a good idea, we should also signal a kernel date when the
old probe method will be removed (IMHO, the next merge window).
Acked-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> ---
> This is only for linux-next for now, in the hope that it will speed up
> the conversion of the remaining legacy i2c drivers.
>
> include/linux/i2c.h | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> --- linux-2.6.29-rc1.orig/include/linux/i2c.h 2009-01-12 18:43:41.000000000 +0100
> +++ linux-2.6.29-rc1/include/linux/i2c.h 2009-01-13 14:37:27.000000000 +0100
> @@ -151,7 +151,7 @@ struct i2c_driver {
> * has been dynamically allocated by the driver in the function above,
> * it must be freed here. (LEGACY I2C DRIVERS ONLY)
> */
> - int (*detach_client)(struct i2c_client *);
> + int (*detach_client)(struct i2c_client *) __deprecated;
>
> /* Standard driver model interfaces, for "new style" i2c drivers.
> * With the driver model, device enumeration is NEVER done by drivers;
> @@ -429,8 +429,10 @@ static inline int i2c_add_driver(struct
> return i2c_register_driver(THIS_MODULE, driver);
> }
>
> -extern int i2c_attach_client(struct i2c_client *);
> -extern int i2c_detach_client(struct i2c_client *);
> +/* These are deprecated, your driver should use the standard .probe()
> + * and .remove() methods instead. */
> +extern int __deprecated i2c_attach_client(struct i2c_client *);
> +extern int __deprecated i2c_detach_client(struct i2c_client *);
>
> extern struct i2c_client *i2c_use_client(struct i2c_client *client);
> extern void i2c_release_client(struct i2c_client *client);
>
>
> --
> Jean Delvare
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: Warn on deprecated binding model use
[not found] ` <20090113154428.GK8032-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
@ 2009-01-13 16:04 ` Jean Delvare
0 siblings, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2009-01-13 16:04 UTC (permalink / raw)
To: Ben Dooks; +Cc: Linux I2C
Hi Ben,
On Tue, 13 Jan 2009 15:44:29 +0000, Ben Dooks wrote:
> On Tue, Jan 13, 2009 at 02:40:44PM +0100, Jean Delvare wrote:
> > Let the kernel developers know that i2c_attach_client() and
> > i2c_detach_client() are deprecated and should no longer be used.
> > Drivers using these should be converted to the standard device
> > driver binding model (probe and remove methods.)
> >
> > Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
>
> This is a good idea, we should also signal a kernel date when the
> old probe method will be removed (IMHO, the next merge window).
There's an entry in feature-removal-schedule.txt already:
What: i2c_attach_client(), i2c_detach_client(), i2c_driver->detach_client()
When: 2.6.29 (ideally) or 2.6.30 (more likely)
Why: Deprecated by the new (standard) device driver binding model. Use
i2c_driver->probe() and ->remove() instead.
Who: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
I'd say this is sufficient?
> Acked-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Thanks,
--
Jean Delvare
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-13 16:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-13 13:40 [PATCH] i2c: Warn on deprecated binding model use Jean Delvare
[not found] ` <20090113144044.5b6fb53a-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-01-13 15:44 ` Ben Dooks
[not found] ` <20090113154428.GK8032-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-01-13 16:04 ` Jean Delvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox