i2c: Simplify i2c_del_driver()

i2c_del_driver() can be simplified a bit.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
Jean Delvare 2008-07-14 22:38:26 +02:00 committed by Jean Delvare
parent 6a03cd9311
commit f7050bd716

View 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;
/* legacy driver? */
if (!is_newstyle_driver(driver))
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);
pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name);