i2c_del_driver() can be simplified a bit.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
{
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);