Commit 71bcb29d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Petr Vandrovec

[PATCH] i2c: remove *data from i2c_adapter, as dev->data should be used instead.

parent 50fb80a9
......@@ -150,7 +150,7 @@ static int __init i2c_bitelv_init(void)
return -ENODEV;
}
} else {
bit_elv_ops.data=(void*)base;
i2c_set_adapdata(&bit_elv_ops, (void *)base);
if (bit_elv_init()==0) {
if(i2c_bit_add_bus(&bit_elv_ops) < 0)
return -ENODEV;
......
......@@ -289,7 +289,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
char rw, u8 command, int size,
union i2c_smbus_data *data)
{
struct scx200_acb_iface *iface = adapter->data;
struct scx200_acb_iface *iface = i2c_get_adapdata(adapter);
int len;
u8 *buffer;
u16 cur_word;
......@@ -455,7 +455,7 @@ static int __init scx200_acb_create(int base, int index)
memset(iface, 0, sizeof(*iface));
adapter = &iface->adapter;
adapter->data = iface;
i2c_set_adapdata(adapter, iface);
snprintf(adapter->dev.name, DEVICE_NAME_SIZE, "SCx200 ACB%d", index);
adapter->owner = THIS_MODULE;
adapter->id = I2C_ALGO_SMBUS;
......
......@@ -219,11 +219,6 @@ struct i2c_adapter {
int (*client_register)(struct i2c_client *);
int (*client_unregister)(struct i2c_client *);
void *data; /* private data for the adapter */
/* some data fields that are used by all types */
/* these data fields are readonly to the public */
/* and can be set via the i2c_ioctl call */
/* data fields that are valid for all devices */
struct semaphore bus;
struct semaphore list;
......@@ -242,6 +237,16 @@ struct i2c_adapter {
};
#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
static inline void *i2c_get_adapdata (struct i2c_adapter *dev)
{
return dev_get_drvdata (&dev->dev);
}
static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
{
return dev_set_drvdata (&dev->dev, data);
}
/*flags for the driver struct: */
#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */
#define I2C_DF_DUMMY 0x02 /* do not connect any clients */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment