diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-03-21 00:07:30 -0800 |
|---|---|---|
| committer | Petr Vandrovec <vandrove@vc.cvut.cz> | 2003-03-21 00:07:30 -0800 |
| commit | b56a14716f6c2f356bf3c0b2f71ae4dc6c8c0155 (patch) | |
| tree | a2f6aed1847c7f209562bb85aec769e1a3b6f666 /include/linux/i2c.h | |
| parent | 329e2f3aed7e02e502e76e9fb9063f44f1b87d0c (diff) | |
[PATCH] i2c: remove the data field from struct i2c_client
It's no longer needed, as the struct device should be used instead.
Created i2c_get_clientdata() and i2c_set_clientdata() to access the data.
Diffstat (limited to 'include/linux/i2c.h')
| -rw-r--r-- | include/linux/i2c.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 1004d2530312..956627caacea 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -167,13 +167,22 @@ struct i2c_client { alignment considerations */ struct i2c_adapter *adapter; /* the adapter we sit on */ struct i2c_driver *driver; /* and our access routines */ - void *data; /* for the clients */ int usage_count; /* How many accesses currently */ /* to the client */ struct device dev; /* the device structure */ }; #define to_i2c_client(d) container_of(d, struct i2c_client, dev) +static inline void *i2c_get_clientdata (struct i2c_client *dev) +{ + return dev_get_drvdata (&dev->dev); +} + +static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) +{ + return dev_set_drvdata (&dev->dev, data); +} + /* * The following structs are for those who like to implement new bus drivers: * i2c_algorithm is the interface to a class of hardware solutions which can |
