提交 f7050bd7 编写于 作者: J Jean Delvare 提交者: Jean Delvare

i2c: Simplify i2c_del_driver()

i2c_del_driver() can be simplified a bit.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 6a03cd93
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册