mirror of https://gitee.com/openkylin/linux.git
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:
parent
6a03cd9311
commit
f7050bd716
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue