summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-05-01 23:26:28 +0200
committerJean Delvare <khali@hyperion.delvare>2007-05-01 23:26:28 +0200
commit4ad4eac60667f7c321faae28a3437f7a8b3d17cb (patch)
tree81deece52937d95b078f3efca3f766ae20309d06 /drivers/i2c
parentb31366f4394f7b1e8e1726ba049f294934db4495 (diff)
i2c: i2c_register_driver() cleanup
Minor cleanup in i2c_register_driver(): use list_for_each_entry(). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c7
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)
int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
{
- struct list_head *item;
- struct i2c_adapter *adapter;
int res;
/* 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)
/* now look for instances of driver on our adapters */
if (driver->attach_adapter) {
- list_for_each(item,&adapters) {
- adapter = list_entry(item, struct i2c_adapter, list);
+ struct i2c_adapter *adapter;
+
+ list_for_each_entry(adapter, &adapters, list) {
driver->attach_adapter(adapter);
}
}