diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-07-14 22:38:26 +0200 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 22:38:26 +0200 |
commit | f7050bd716047a4dfec7d061e28df7ffd6815ebd (patch) | |
tree | 2520cb8b75194b4298f3893202a84de14e13e837 /drivers/i2c/i2c-core.c | |
parent | 6a03cd931196673634b58c955d2f9d42da602045 (diff) | |
download | talos-obmc-linux-f7050bd716047a4dfec7d061e28df7ffd6815ebd.tar.gz talos-obmc-linux-f7050bd716047a4dfec7d061e28df7ffd6815ebd.zip |
i2c: Simplify i2c_del_driver()
i2c_del_driver() can be simplified a bit.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 10 |
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) { 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); |