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>
This commit is contained in:
committed by
Jean Delvare
parent
b31366f439
commit
4ad4eac606
@ -304,8 +304,6 @@ int i2c_del_adapter(struct i2c_adapter *adap)
|
|||||||
|
|
||||||
int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
|
int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
|
||||||
{
|
{
|
||||||
struct list_head *item;
|
|
||||||
struct i2c_adapter *adapter;
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
/* add the driver to the list of i2c drivers in the driver core */
|
/* 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 */
|
/* now look for instances of driver on our adapters */
|
||||||
if (driver->attach_adapter) {
|
if (driver->attach_adapter) {
|
||||||
list_for_each(item,&adapters) {
|
struct i2c_adapter *adapter;
|
||||||
adapter = list_entry(item, struct i2c_adapter, list);
|
|
||||||
|
list_for_each_entry(adapter, &adapters, list) {
|
||||||
driver->attach_adapter(adapter);
|
driver->attach_adapter(adapter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user