diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-12-14 15:17:25 -0500 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-12-14 15:17:25 -0500 |
commit | c3813d6af177fab19e322f3114b1f64fbcf08d71 (patch) | |
tree | 5189e18f95c954461040bc4becbca6acf739c13b /drivers/i2c/i2c-core.c | |
parent | 310ec79210d754afe51e2e4a983e846b60179abd (diff) |
i2c: Get rid of struct i2c_client_address_data
Struct i2c_client_address_data only contains one field at this point,
which makes its usefulness questionable. Get rid of it and pass simple
address lists around instead.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index c1047d644d8f..9065c7238b5e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -1214,13 +1214,13 @@ static int i2c_detect_address(struct i2c_client *temp_client, | |||
1214 | 1214 | ||
1215 | static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) | 1215 | static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) |
1216 | { | 1216 | { |
1217 | const struct i2c_client_address_data *address_data; | 1217 | const unsigned short *address_list; |
1218 | struct i2c_client *temp_client; | 1218 | struct i2c_client *temp_client; |
1219 | int i, err = 0; | 1219 | int i, err = 0; |
1220 | int adap_id = i2c_adapter_id(adapter); | 1220 | int adap_id = i2c_adapter_id(adapter); |
1221 | 1221 | ||
1222 | address_data = driver->address_data; | 1222 | address_list = driver->address_list; |
1223 | if (!driver->detect || !address_data) | 1223 | if (!driver->detect || !address_list) |
1224 | return 0; | 1224 | return 0; |
1225 | 1225 | ||
1226 | /* Set up a temporary client to help detect callback */ | 1226 | /* Set up a temporary client to help detect callback */ |
@@ -1235,7 +1235,7 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) | |||
1235 | 1235 | ||
1236 | /* Stop here if we can't use SMBUS_QUICK */ | 1236 | /* Stop here if we can't use SMBUS_QUICK */ |
1237 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { | 1237 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { |
1238 | if (address_data->normal_i2c[0] == I2C_CLIENT_END) | 1238 | if (address_list[0] == I2C_CLIENT_END) |
1239 | goto exit_free; | 1239 | goto exit_free; |
1240 | 1240 | ||
1241 | dev_warn(&adapter->dev, "SMBus Quick command not supported, " | 1241 | dev_warn(&adapter->dev, "SMBus Quick command not supported, " |
@@ -1244,11 +1244,10 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) | |||
1244 | goto exit_free; | 1244 | goto exit_free; |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | for (i = 0; address_data->normal_i2c[i] != I2C_CLIENT_END; i += 1) { | 1247 | for (i = 0; address_list[i] != I2C_CLIENT_END; i += 1) { |
1248 | dev_dbg(&adapter->dev, "found normal entry for adapter %d, " | 1248 | dev_dbg(&adapter->dev, "found normal entry for adapter %d, " |
1249 | "addr 0x%02x\n", adap_id, | 1249 | "addr 0x%02x\n", adap_id, address_list[i]); |
1250 | address_data->normal_i2c[i]); | 1250 | temp_client->addr = address_list[i]; |
1251 | temp_client->addr = address_data->normal_i2c[i]; | ||
1252 | err = i2c_detect_address(temp_client, driver); | 1251 | err = i2c_detect_address(temp_client, driver); |
1253 | if (err) | 1252 | if (err) |
1254 | goto exit_free; | 1253 | goto exit_free; |