aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-01-27 12:14:51 -0500
committerJean Delvare <khali@hyperion.delvare>2008-01-27 12:14:51 -0500
commit9b766b814d6a5f31ca1e9da1ebc08164b9352941 (patch)
treece6256c11002c356ee8b632f2a7d08793dd30f82 /include/linux/i2c.h
parent0d227a7e724460bddcd603a1feb672267bcb0d6c (diff)
i2c: Stop using the redundant client list
The i2c_adapter.clients list of i2c_client nodes duplicates driver model state. This patch starts removing that list, letting us remove most existing users of those i2c-core lists. * The core I2C code now iterates over the driver model's list instead of the i2c-internal one in some places where it's safe: - Passing a command/ioctl to each client, a mechanims used almost exclusively by DVB adapters; - Device address checking, in both i2c-core and i2c-dev. * Provide i2c_verify_client() to use with driver model iterators. * Flag the relevant i2c_adapter and i2c_client fields as deprecated, to help prevent new users from appearing. For the moment the list needs to stick around, since some issues show up when deleting devices created by legacy I2C drivers. (They don't follow standard driver model rules. Removing those devices can cause self-deadlocks.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'include/linux/i2c.h')
-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 0fc59efd80e..731928ae972 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -158,7 +158,7 @@ struct i2c_driver {
158 * @irq: indicates the IRQ generated by this device (if any) 158 * @irq: indicates the IRQ generated by this device (if any)
159 * @driver_name: Identifies new-style driver used with this device; also 159 * @driver_name: Identifies new-style driver used with this device; also
160 * used as the module name for hotplug/coldplug modprobe support. 160 * used as the module name for hotplug/coldplug modprobe support.
161 * @list: list of active/busy clients 161 * @list: list of active/busy clients (DEPRECATED)
162 * @released: used to synchronize client releases & detaches and references 162 * @released: used to synchronize client releases & detaches and references
163 * 163 *
164 * An i2c_client identifies a single device (i.e. chip) connected to an 164 * An i2c_client identifies a single device (i.e. chip) connected to an
@@ -176,11 +176,13 @@ struct i2c_client {
176 struct device dev; /* the device structure */ 176 struct device dev; /* the device structure */
177 int irq; /* irq issued by device (or -1) */ 177 int irq; /* irq issued by device (or -1) */
178 char driver_name[KOBJ_NAME_LEN]; 178 char driver_name[KOBJ_NAME_LEN];
179 struct list_head list; 179 struct list_head list; /* DEPRECATED */
180 struct completion released; 180 struct completion released;
181}; 181};
182#define to_i2c_client(d) container_of(d, struct i2c_client, dev) 182#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
183 183
184extern struct i2c_client *i2c_verify_client(struct device *dev);
185
184static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) 186static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
185{ 187{
186 struct device * const dev = container_of(kobj, struct device, kobj); 188 struct device * const dev = container_of(kobj, struct device, kobj);
@@ -315,7 +317,7 @@ struct i2c_adapter {
315 struct device dev; /* the adapter device */ 317 struct device dev; /* the adapter device */
316 318
317 int nr; 319 int nr;
318 struct list_head clients; 320 struct list_head clients; /* DEPRECATED */
319 char name[48]; 321 char name[48];
320 struct completion dev_released; 322 struct completion dev_released;
321}; 323};