[patch 2/2] i2c_del_driver(): use list_for_each_entry_safe()

From: matthias
Date: Mon May 19 2008 - 16:51:34 EST


i2c-core.c: use list_for_each_entry_safe() in i2c_del_driver()

Signed-off-by: Matthias Kaehlcke <matthias@xxxxxxxxxxxx>

Index: linux-2.6/drivers/i2c/i2c-core.c
===================================================================
--- linux-2.6.orig/drivers/i2c/i2c-core.c 2008-05-19 22:33:04.000000000 +0200
+++ linux-2.6/drivers/i2c/i2c-core.c 2008-05-19 22:33:51.000000000 +0200
@@ -707,8 +707,7 @@
*/
void i2c_del_driver(struct i2c_driver *driver)
{
- struct list_head *item2, *_n;
- struct i2c_client *client;
+ struct i2c_client *client, *_n;
struct i2c_adapter *adap;

mutex_lock(&core_lock);
@@ -730,8 +729,7 @@
driver->driver.name);
}
} else {
- list_for_each_safe(item2, _n, &adap->clients) {
- client = list_entry(item2, struct i2c_client, list);
+ list_for_each_entry_safe(client, _n, &adap->clients, list) {
if (client->driver != driver)
continue;
dev_dbg(&adap->dev, "detaching client [%s] "

--
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

We build too many walls and not enough bridges
(Isaac Newton)
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/