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) ...@@ -150,7 +150,7 @@ static int __init i2c_bitelv_init(void)
return -ENODEV; return -ENODEV;
} }
} else { } else {
bit_elv_ops.data=(void*)base; i2c_set_adapdata(&bit_elv_ops, (void *)base);
if (bit_elv_init()==0) { if (bit_elv_init()==0) {
if(i2c_bit_add_bus(&bit_elv_ops) < 0) if(i2c_bit_add_bus(&bit_elv_ops) < 0)
return -ENODEV; return -ENODEV;
......
...@@ -289,7 +289,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter, ...@@ -289,7 +289,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
char rw, u8 command, int size, char rw, u8 command, int size,
union i2c_smbus_data *data) union i2c_smbus_data *data)
{ {
struct scx200_acb_iface *iface = adapter->data; struct scx200_acb_iface *iface = i2c_get_adapdata(adapter);
int len; int len;
u8 *buffer; u8 *buffer;
u16 cur_word; u16 cur_word;
...@@ -455,7 +455,7 @@ static int __init scx200_acb_create(int base, int index) ...@@ -455,7 +455,7 @@ static int __init scx200_acb_create(int base, int index)
memset(iface, 0, sizeof(*iface)); memset(iface, 0, sizeof(*iface));
adapter = &iface->adapter; adapter = &iface->adapter;
adapter->data = iface; i2c_set_adapdata(adapter, iface);
snprintf(adapter->dev.name, DEVICE_NAME_SIZE, "SCx200 ACB%d", index); snprintf(adapter->dev.name, DEVICE_NAME_SIZE, "SCx200 ACB%d", index);
adapter->owner = THIS_MODULE; adapter->owner = THIS_MODULE;
adapter->id = I2C_ALGO_SMBUS; adapter->id = I2C_ALGO_SMBUS;
......
...@@ -219,12 +219,7 @@ struct i2c_adapter { ...@@ -219,12 +219,7 @@ struct i2c_adapter {
int (*client_register)(struct i2c_client *); int (*client_register)(struct i2c_client *);
int (*client_unregister)(struct i2c_client *); int (*client_unregister)(struct i2c_client *);
void *data; /* private data for the adapter */ /* data fields that are valid for all devices */
/* 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 bus;
struct semaphore list; struct semaphore list;
unsigned int flags;/* flags specifying div. data */ unsigned int flags;/* flags specifying div. data */
...@@ -242,6 +237,16 @@ struct i2c_adapter { ...@@ -242,6 +237,16 @@ struct i2c_adapter {
}; };
#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) #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: */ /*flags for the driver struct: */
#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ #define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */
#define I2C_DF_DUMMY 0x02 /* do not connect any clients */ #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