summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-isa.c
diff options
context:
space:
mode:
authorDavid Hubbard <david.c.hubbard@gmail.com>2006-09-03 22:21:20 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 00:38:51 +0200
commit8202632647278eba7223727dc442f49227c040d0 (patch)
tree922573b40bc3f9332ac431e1bf7b3276750e9d3a /drivers/i2c/busses/i2c-isa.c
parenti2c: __must_check fixes (chip drivers) (diff)
downloadlinux-8202632647278eba7223727dc442f49227c040d0.tar.xz
linux-8202632647278eba7223727dc442f49227c040d0.zip
i2c-isa: Fail adding driver on attach_adapter error
i2c-isa: Fail adding driver on attach_adapter error Signed-off-by: David Hubbard <david.c.hubbard@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-isa.c')
-rw-r--r--drivers/i2c/busses/i2c-isa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
index d7486e586068..7a8d2c148a80 100644
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -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)