diff options
-rw-r--r-- | drivers/i2c/i2c-core.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 8dca4848ad92..7bfd67f4143d 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -304,8 +304,6 @@ int i2c_del_adapter(struct i2c_adapter *adap) | |||
304 | 304 | ||
305 | int i2c_register_driver(struct module *owner, struct i2c_driver *driver) | 305 | int i2c_register_driver(struct module *owner, struct i2c_driver *driver) |
306 | { | 306 | { |
307 | struct list_head *item; | ||
308 | struct i2c_adapter *adapter; | ||
309 | int res; | 307 | int res; |
310 | 308 | ||
311 | /* add the driver to the list of i2c drivers in the driver core */ | 309 | /* add the driver to the list of i2c drivers in the driver core */ |
@@ -323,8 +321,9 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver) | |||
323 | 321 | ||
324 | /* now look for instances of driver on our adapters */ | 322 | /* now look for instances of driver on our adapters */ |
325 | if (driver->attach_adapter) { | 323 | if (driver->attach_adapter) { |
326 | list_for_each(item,&adapters) { | 324 | struct i2c_adapter *adapter; |
327 | adapter = list_entry(item, struct i2c_adapter, list); | 325 | |
326 | list_for_each_entry(adapter, &adapters, list) { | ||
328 | driver->attach_adapter(adapter); | 327 | driver->attach_adapter(adapter); |
329 | } | 328 | } |
330 | } | 329 | } |