lkml.org 
[lkml]   [2008]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 2/2] i2c_del_driver(): use list_for_each_entry_safe()
i2c-core.c: use list_for_each_entry_safe() in i2c_del_driver()

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>

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 `-

\
 
 \ /
  Last update: 2008-05-19 22:53    [W:0.082 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site