Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fb4523a authored by Jean Delvare's avatar Jean Delvare
Browse files

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: default avatarJean Delvare <khali@linux-fr.org>
Acked-by: default avatarBen Dooks <ben-linux@fluff.org>
parent dd7f8dbe
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -151,7 +151,7 @@ struct i2c_driver {
	 * has been dynamically allocated by the driver in the function above,
	 * has been dynamically allocated by the driver in the function above,
	 * it must be freed here.  (LEGACY I2C DRIVERS ONLY)
	 * 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.
	/* Standard driver model interfaces, for "new style" i2c drivers.
	 * With the driver model, device enumeration is NEVER done by drivers;
	 * 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)
	return i2c_register_driver(THIS_MODULE, driver);
	return i2c_register_driver(THIS_MODULE, driver);
}
}


extern int i2c_attach_client(struct i2c_client *);
/* These are deprecated, your driver should use the standard .probe()
extern int i2c_detach_client(struct i2c_client *);
 * 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 struct i2c_client *i2c_use_client(struct i2c_client *client);
extern void i2c_release_client(struct i2c_client *client);
extern void i2c_release_client(struct i2c_client *client);