diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-07-14 16:38:36 -0400 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 16:38:36 -0400 |
commit | f741f673298b03b92d46e30b0b6fd0e960423665 (patch) | |
tree | 73a48fc17a8022b50d0da55fb3fd6f2d686582e6 /drivers/i2c/chips/pcf8574.c | |
parent | b1204e6ec16468ebf89d9d818bfe425ca7adcdf3 (diff) |
i2c: Clean up old chip drivers
Clean up old i2c chip drivers:
* Name the i2c_client "client" instead of "new_client".
* Drop useless initializations to 0.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/chips/pcf8574.c')
-rw-r--r-- | drivers/i2c/chips/pcf8574.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c index ad2f7901a8c9..1b3db2b3ada9 100644 --- a/drivers/i2c/chips/pcf8574.c +++ b/drivers/i2c/chips/pcf8574.c | |||
@@ -127,7 +127,7 @@ static int pcf8574_attach_adapter(struct i2c_adapter *adapter) | |||
127 | /* This function is called by i2c_probe */ | 127 | /* This function is called by i2c_probe */ |
128 | static int pcf8574_detect(struct i2c_adapter *adapter, int address, int kind) | 128 | static int pcf8574_detect(struct i2c_adapter *adapter, int address, int kind) |
129 | { | 129 | { |
130 | struct i2c_client *new_client; | 130 | struct i2c_client *client; |
131 | struct pcf8574_data *data; | 131 | struct pcf8574_data *data; |
132 | int err = 0; | 132 | int err = 0; |
133 | const char *client_name = ""; | 133 | const char *client_name = ""; |
@@ -142,12 +142,11 @@ static int pcf8574_detect(struct i2c_adapter *adapter, int address, int kind) | |||
142 | goto exit; | 142 | goto exit; |
143 | } | 143 | } |
144 | 144 | ||
145 | new_client = &data->client; | 145 | client = &data->client; |
146 | i2c_set_clientdata(new_client, data); | 146 | i2c_set_clientdata(client, data); |
147 | new_client->addr = address; | 147 | client->addr = address; |
148 | new_client->adapter = adapter; | 148 | client->adapter = adapter; |
149 | new_client->driver = &pcf8574_driver; | 149 | client->driver = &pcf8574_driver; |
150 | new_client->flags = 0; | ||
151 | 150 | ||
152 | /* Now, we would do the remaining detection. But the PCF8574 is plainly | 151 | /* Now, we would do the remaining detection. But the PCF8574 is plainly |
153 | impossible to detect! Stupid chip. */ | 152 | impossible to detect! Stupid chip. */ |
@@ -166,23 +165,23 @@ static int pcf8574_detect(struct i2c_adapter *adapter, int address, int kind) | |||
166 | client_name = "pcf8574"; | 165 | client_name = "pcf8574"; |
167 | 166 | ||
168 | /* Fill in the remaining client fields and put it into the global list */ | 167 | /* Fill in the remaining client fields and put it into the global list */ |
169 | strlcpy(new_client->name, client_name, I2C_NAME_SIZE); | 168 | strlcpy(client->name, client_name, I2C_NAME_SIZE); |
170 | 169 | ||
171 | /* Tell the I2C layer a new client has arrived */ | 170 | /* Tell the I2C layer a new client has arrived */ |
172 | if ((err = i2c_attach_client(new_client))) | 171 | if ((err = i2c_attach_client(client))) |
173 | goto exit_free; | 172 | goto exit_free; |
174 | 173 | ||
175 | /* Initialize the PCF8574 chip */ | 174 | /* Initialize the PCF8574 chip */ |
176 | pcf8574_init_client(new_client); | 175 | pcf8574_init_client(client); |
177 | 176 | ||
178 | /* Register sysfs hooks */ | 177 | /* Register sysfs hooks */ |
179 | err = sysfs_create_group(&new_client->dev.kobj, &pcf8574_attr_group); | 178 | err = sysfs_create_group(&client->dev.kobj, &pcf8574_attr_group); |
180 | if (err) | 179 | if (err) |
181 | goto exit_detach; | 180 | goto exit_detach; |
182 | return 0; | 181 | return 0; |
183 | 182 | ||
184 | exit_detach: | 183 | exit_detach: |
185 | i2c_detach_client(new_client); | 184 | i2c_detach_client(client); |
186 | exit_free: | 185 | exit_free: |
187 | kfree(data); | 186 | kfree(data); |
188 | exit: | 187 | exit: |