Commit 038963f5 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

[PATCH] I2C: Kill i2c_client.id (3/5)

(3/5) Stop using i2c_client.id in misc drivers.

Affected drivers:
* acorn/char/pcf8583
* acorn/char/i2c
* i2c/i2c-dev
* macintosh/therm_windtunnel
* sound/oss/dmasound/dac3550a
* sound/ppc/keywest

The Acorn pcf8583 driver would give the i2c_client id the same value as
the i2c_driver id, and later test that client id (in i2c). I changed it
to test the client's driver id instead. The result is the same and the
client id is then useless and can be removed.

All other drivers here would allocate the client id to some value and
then never use it. They are unaffected by the change.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 24e36cfe
......@@ -313,7 +313,7 @@ static struct i2c_algo_bit_data ioc_data = {
static int ioc_client_reg(struct i2c_client *client)
{
if (client->id == I2C_DRIVERID_PCF8583 &&
if (client->driver->id == I2C_DRIVERID_PCF8583 &&
client->addr == 0x50) {
struct rtc_tm rtctm;
unsigned int year;
......
......@@ -51,7 +51,6 @@ pcf8583_attach(struct i2c_adapter *adap, int addr, int kind)
return -ENOMEM;
memset(c, 0, sizeof(*c));
c->id = pcf8583_driver.id;
c->addr = addr;
c->adapter = adap;
c->driver = &pcf8583_driver;
......
......@@ -507,7 +507,6 @@ static struct i2c_driver i2cdev_driver = {
static struct i2c_client i2cdev_client_template = {
.name = "I2C /dev entry",
.id = 1,
.addr = -1,
.driver = &i2cdev_driver,
};
......
......@@ -47,8 +47,6 @@
#define LOG_TEMP 0 /* continously log temperature */
#define I2C_DRIVERID_G4FAN 0x9001 /* fixme */
#define THERMOSTAT_CLIENT_ID 1
#define FAN_CLIENT_ID 2
static int do_probe( struct i2c_adapter *adapter, int addr, int kind);
......@@ -372,7 +370,6 @@ attach_fan( struct i2c_client *cl )
goto out;
printk("ADM1030 fan controller [@%02x]\n", cl->addr );
cl->id = FAN_CLIENT_ID;
strlcpy( cl->name, "ADM1030 fan controller", sizeof(cl->name) );
if( !i2c_attach_client(cl) )
......@@ -412,7 +409,6 @@ attach_thermostat( struct i2c_client *cl )
x.overheat_temp = os_temp;
x.overheat_hyst = hyst_temp;
cl->id = THERMOSTAT_CLIENT_ID;
strlcpy( cl->name, "DS1775 thermostat", sizeof(cl->name) );
if( !i2c_attach_client(cl) )
......
......@@ -40,9 +40,6 @@ static int daca_attach_adapter(struct i2c_adapter *adapter);
static int daca_detect_client(struct i2c_adapter *adapter, int address);
static int daca_detach_client(struct i2c_client *client);
/* Unique ID allocation */
static int daca_id;
struct i2c_driver daca_driver = {
.owner = THIS_MODULE,
.name = "DAC3550A driver V " DACA_VERSION,
......@@ -176,7 +173,6 @@ static int daca_detect_client(struct i2c_adapter *adapter, int address)
new_client->driver = &daca_driver;
new_client->flags = 0;
strcpy(new_client->name, client_name);
new_client->id = daca_id++; /* racy... */
if (daca_init_client(new_client))
goto bail;
......
......@@ -76,8 +76,6 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
new_client->flags = 0;
strcpy(i2c_device_name(new_client), keywest_ctx->name);
new_client->id = keywest_ctx->id++; /* Automatically unique */
keywest_ctx->client = new_client;
/* Tell the i2c layer a new client has arrived */
......
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