diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-01-26 15:19:57 -0500 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-01-26 15:19:57 -0500 |
commit | 5fb4523afbffae5a5cec4989ee4c9fbc3dbdef33 (patch) | |
tree | 498c51141686d9e7c645e4d1b98f435e1faaeb14 | |
parent | dd7f8dbe2b3c0611ba969cd867c10cb63d163e25 (diff) |
i2c: Warn on deprecated binding model use
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@linux-fr.org>
Acked-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | include/linux/i2c.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 20873d402467..fcfbfea3af72 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -151,7 +151,7 @@ struct i2c_driver { | |||
151 | * has been dynamically allocated by the driver in the function above, | 151 | * has been dynamically allocated by the driver in the function above, |
152 | * it must be freed here. (LEGACY I2C DRIVERS ONLY) | 152 | * it must be freed here. (LEGACY I2C DRIVERS ONLY) |
153 | */ | 153 | */ |
154 | int (*detach_client)(struct i2c_client *); | 154 | int (*detach_client)(struct i2c_client *) __deprecated; |
155 | 155 | ||
156 | /* Standard driver model interfaces, for "new style" i2c drivers. | 156 | /* Standard driver model interfaces, for "new style" i2c drivers. |
157 | * With the driver model, device enumeration is NEVER done by drivers; | 157 | * With the driver model, device enumeration is NEVER done by drivers; |
@@ -429,8 +429,10 @@ static inline int i2c_add_driver(struct i2c_driver *driver) | |||
429 | return i2c_register_driver(THIS_MODULE, driver); | 429 | return i2c_register_driver(THIS_MODULE, driver); |
430 | } | 430 | } |
431 | 431 | ||
432 | extern int i2c_attach_client(struct i2c_client *); | 432 | /* These are deprecated, your driver should use the standard .probe() |
433 | extern int i2c_detach_client(struct i2c_client *); | 433 | * and .remove() methods instead. */ |
434 | extern int __deprecated i2c_attach_client(struct i2c_client *); | ||
435 | extern int __deprecated i2c_detach_client(struct i2c_client *); | ||
434 | 436 | ||
435 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); | 437 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); |
436 | extern void i2c_release_client(struct i2c_client *client); | 438 | extern void i2c_release_client(struct i2c_client *client); |