Commit f7050bd7 authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

i2c: Simplify i2c_del_driver()

i2c_del_driver() can be simplified a bit.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 6a03cd93
...@@ -743,13 +743,11 @@ void i2c_del_driver(struct i2c_driver *driver) ...@@ -743,13 +743,11 @@ void i2c_del_driver(struct i2c_driver *driver)
{ {
mutex_lock(&core_lock); mutex_lock(&core_lock);
/* new-style driver? */ /* legacy driver? */
if (is_newstyle_driver(driver)) if (!is_newstyle_driver(driver))
goto unregister; class_for_each_device(&i2c_adapter_class, driver,
__detach_adapter);
class_for_each_device(&i2c_adapter_class, driver, __detach_adapter);
unregister:
driver_unregister(&driver->driver); driver_unregister(&driver->driver);
pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name); pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment