diff options
-rw-r--r-- | drivers/i2c/busses/i2c-isa.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c index d7486e5..7a8d2c1 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) |