Commit 82026326 authored by David Hubbard's avatar David Hubbard Committed by Greg Kroah-Hartman

i2c-isa: Fail adding driver on attach_adapter error

i2c-isa: Fail adding driver on attach_adapter error
Signed-off-by: default avatarDavid Hubbard <david.c.hubbard@gmail.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7d9db67f
......@@ -89,9 +89,14 @@ int i2c_isa_add_driver(struct i2c_driver *driver)
dev_dbg(&isa_adapter.dev, "Driver %s registered\n", driver->driver.name);
/* Now look for clients */
driver->attach_adapter(&isa_adapter);
return 0;
res = driver->attach_adapter(&isa_adapter);
if (res) {
dev_err(&isa_adapter.dev,
"Driver %s failed to attach adapter, unregistering\n",
driver->driver.name);
driver_unregister(&driver->driver);
}
return res;
}
int i2c_isa_del_driver(struct i2c_driver *driver)
......
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