From: Jean Delvare Date: Fri, 28 Nov 2008 14:24:38 +0000 (+0100) Subject: i2c: Remove i2c clients in reverse order X-Git-Tag: v2.6.28-rc7~52^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=79b93e1359b1414b438f239c6e5e0ad91232e4c8;p=linux-2.6-omap-h63xx.git i2c: Remove i2c clients in reverse order i2c clients should be removed in reverse order compared to the probe (actually: bind) order. This matters when several clients depend on each other. Signed-off-by: Jean Delvare Tested-by: Guennadi Liakhovetski --- diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 5a485c22660..c6a63f46bc1 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -631,7 +631,7 @@ int i2c_del_adapter(struct i2c_adapter *adap) /* detach any active clients. This must be done first, because * it can fail; in which case we give up. */ - list_for_each_entry_safe(client, _n, &adap->clients, list) { + list_for_each_entry_safe_reverse(client, _n, &adap->clients, list) { struct i2c_driver *driver; driver = client->driver;