aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-01-26 15:19:57 -0500
committerJean Delvare <khali@linux-fr.org>2009-01-26 15:19:57 -0500
commit5fb4523afbffae5a5cec4989ee4c9fbc3dbdef33 (patch)
tree498c51141686d9e7c645e4d1b98f435e1faaeb14
parentdd7f8dbe2b3c0611ba969cd867c10cb63d163e25 (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.h8
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
432extern int i2c_attach_client(struct i2c_client *); 432/* These are deprecated, your driver should use the standard .probe()
433extern int i2c_detach_client(struct i2c_client *); 433 * and .remove() methods instead. */
434extern int __deprecated i2c_attach_client(struct i2c_client *);
435extern int __deprecated i2c_detach_client(struct i2c_client *);
434 436
435extern struct i2c_client *i2c_use_client(struct i2c_client *client); 437extern struct i2c_client *i2c_use_client(struct i2c_client *client);
436extern void i2c_release_client(struct i2c_client *client); 438extern void i2c_release_client(struct i2c_client *client);