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

i2c: Removed the name variable from i2c_client as the dev one should be used instead.

parent b56a1471
......@@ -299,7 +299,7 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address,
}
/* Fill in the remaining client fields and put it into the global list */
strcpy(new_client->name, client_name);
strncpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE);
data->type = kind;
new_client->id = adm1021_id++;
......
......@@ -180,7 +180,7 @@ static int lm75_detect(struct i2c_adapter *adapter, int address,
}
/* Fill in the remaining client fields and put it into the global list */
strcpy(new_client->name, client_name);
strncpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE);
new_client->id = lm75_id++;
data->valid = 0;
......
......@@ -291,7 +291,7 @@ int i2c_del_driver(struct i2c_driver *driver)
client->driver == driver) {
DEB2(printk(KERN_DEBUG "i2c-core.o: "
"detaching client %s:\n",
client->name));
client->dev.name));
if ((res = driver->detach_client(client))) {
dev_err(&adap->dev, "while "
"unregistering driver "
......@@ -355,7 +355,7 @@ int i2c_attach_client(struct i2c_client *client)
printk(KERN_WARNING
" i2c-core.o: attach_client(%s) - enlarge I2C_CLIENT_MAX.\n",
client->name);
client->dev.name);
out_unlock_list:
up(&adapter->list);
......@@ -374,7 +374,7 @@ int i2c_attach_client(struct i2c_client *client)
}
DEB(dev_dbg(&adapter->dev, "client [%s] registered to adapter "
"(pos. %d).\n", client->name, i));
"(pos. %d).\n", client->dev.name, i));
if (client->flags & I2C_CLIENT_ALLOW_USE)
client->usage_count = 0;
......@@ -395,7 +395,7 @@ int i2c_detach_client(struct i2c_client *client)
if (res) {
printk(KERN_ERR
"i2c-core.o: client_unregister [%s] failed, "
"client not detached", client->name);
"client not detached", client->dev.name);
goto out;
}
}
......@@ -410,7 +410,7 @@ int i2c_detach_client(struct i2c_client *client)
printk(KERN_WARNING
" i2c-core.o: unregister_client [%s] not found\n",
client->name);
client->dev.name);
res = -ENODEV;
out_unlock:
......@@ -522,7 +522,7 @@ static ssize_t i2cproc_bus_read(struct file *file, char *buf,
client = adapters[i]->clients[order[j]];
len += sprintf(kbuf+len,"%02x\t%-32s\t%-32s\n",
client->addr,
client->name,
client->dev.name,
client->driver->name);
}
len = len - file->f_pos;
......
......@@ -86,7 +86,9 @@ static struct i2c_driver i2cdev_driver = {
};
static struct i2c_client i2cdev_client_template = {
.dev = {
.name = "I2C /dev entry",
},
.id = 1,
.addr = -1,
.driver = &i2cdev_driver,
......
......@@ -156,7 +156,6 @@ extern struct bus_type i2c_bus_type;
* function is mainly used for lookup & other admin. functions.
*/
struct i2c_client {
char name[32];
int id;
unsigned int flags; /* div., see below */
unsigned int addr; /* chip address - NOTE: 7bit */
......
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