aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 1a71645038f0..e06067ebd205 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -743,13 +743,11 @@ void i2c_del_driver(struct i2c_driver *driver)
743{ 743{
744 mutex_lock(&core_lock); 744 mutex_lock(&core_lock);
745 745
746 /* new-style driver? */ 746 /* legacy driver? */
747 if (is_newstyle_driver(driver)) 747 if (!is_newstyle_driver(driver))
748 goto unregister; 748 class_for_each_device(&i2c_adapter_class, driver,
749 749 __detach_adapter);
750 class_for_each_device(&i2c_adapter_class, driver, __detach_adapter);
751 750
752 unregister:
753 driver_unregister(&driver->driver); 751 driver_unregister(&driver->driver);
754 pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name); 752 pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name);
755 753