aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-07-16 13:30:05 -0400
committerJean Delvare <khali@mahadeva.delvare>2008-07-16 13:30:05 -0400
commitbd4bc3dbded9cd7b2bdca6bba1aecb4251a8039d (patch)
tree463f7b4283b3924abf504e4db020050bd2b55db5 /drivers/i2c/i2c-core.c
parent45158894d4d6704afbb4cefe55e5f6ca279fe12a (diff)
i2c: Clear i2c_adapter.dev on adapter removal
Clear i2c_adapter.dev on adapter removal. This makes it possible to re-add the adapter at a later point, which some drivers (i2c-amd756-s4882, i2c-nforce2-s4985) actually do. This fixes a bug reported by John Stultz here: http://lkml.org/lkml/2008/7/15/720 and by Ingo Molar there: http://lkml.org/lkml/2008/7/16/78 Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 0a79f7661017..7608df83d6d1 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -654,6 +654,10 @@ int i2c_del_adapter(struct i2c_adapter *adap)
654 654
655 dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name); 655 dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name);
656 656
657 /* Clear the device structure in case this adapter is ever going to be
658 added again */
659 memset(&adap->dev, 0, sizeof(adap->dev));
660
657 out_unlock: 661 out_unlock:
658 mutex_unlock(&core_lock); 662 mutex_unlock(&core_lock);
659 return res; 663 return res;