]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
i2c: Simplify i2c_del_driver()
authorJean Delvare <khali@linux-fr.org>
Mon, 14 Jul 2008 20:38:26 +0000 (22:38 +0200)
committerJean Delvare <khali@mahadeva.delvare>
Mon, 14 Jul 2008 20:38:26 +0000 (22:38 +0200)
i2c_del_driver() can be simplified a bit.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/i2c-core.c

index 1a71645038f0d745e8eb4d96ae6da5af69b9244e..e06067ebd2050c83a6bb5355d9c4a004a7985edf 100644 (file)
@@ -743,13 +743,11 @@ void i2c_del_driver(struct i2c_driver *driver)
 {
        mutex_lock(&core_lock);
 
-       /* new-style driver? */
-       if (is_newstyle_driver(driver))
-               goto unregister;
-
-       class_for_each_device(&i2c_adapter_class, driver, __detach_adapter);
+       /* legacy driver? */
+       if (!is_newstyle_driver(driver))
+               class_for_each_device(&i2c_adapter_class, driver,
+                                     __detach_adapter);
 
- unregister:
        driver_unregister(&driver->driver);
        pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name);