diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/chips/ds1337.c | 5 | ||||
-rw-r--r-- | drivers/i2c/chips/eeprom.c | 4 | ||||
-rw-r--r-- | drivers/i2c/chips/max6875.c | 4 | ||||
-rw-r--r-- | drivers/i2c/chips/pca9539.c | 4 | ||||
-rw-r--r-- | drivers/i2c/chips/pcf8574.c | 5 | ||||
-rw-r--r-- | drivers/i2c/chips/pcf8591.c | 5 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 6 |
7 files changed, 11 insertions, 22 deletions
diff --git a/drivers/i2c/chips/ds1337.c b/drivers/i2c/chips/ds1337.c index 6ac0a6e..8ab4e23 100644 --- a/drivers/i2c/chips/ds1337.c +++ b/drivers/i2c/chips/ds1337.c @@ -353,11 +353,8 @@ static int ds1337_detach_client(struct i2c_client *client) int err; struct ds1337_data *data = i2c_get_clientdata(client); - if ((err = i2c_detach_client(client))) { - dev_err(&client->dev, "Client deregistration failed, " - "client not detached.\n"); + if ((err = i2c_detach_client(client))) return err; - } list_del(&data->list); kfree(data); diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index 88f83ba..9466ada 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c @@ -230,10 +230,8 @@ static int eeprom_detach_client(struct i2c_client *client) int err; err = i2c_detach_client(client); - if (err) { - dev_err(&client->dev, "Client deregistration failed, client not detached.\n"); + if (err) return err; - } kfree(i2c_get_clientdata(client)); diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index d1d4858..52fd6bf 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c @@ -242,10 +242,8 @@ static int max6875_detach_client(struct i2c_client *client) int err; err = i2c_detach_client(client); - if (err) { - dev_err(&client->dev, "i2c_detach_client() failed\n"); + if (err) return err; - } kfree(i2c_get_clientdata(client)); return 0; } diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c index c5b0523..1500b18 100644 --- a/drivers/i2c/chips/pca9539.c +++ b/drivers/i2c/chips/pca9539.c @@ -163,10 +163,8 @@ static int pca9539_detach_client(struct i2c_client *client) { int err; - if ((err = i2c_detach_client(client))) { - dev_err(&client->dev, "Client deregistration failed.\n"); + if ((err = i2c_detach_client(client))) return err; - } kfree(i2c_get_clientdata(client)); return 0; diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c index 7a1fa79..a109dfd 100644 --- a/drivers/i2c/chips/pcf8574.c +++ b/drivers/i2c/chips/pcf8574.c @@ -185,11 +185,8 @@ static int pcf8574_detach_client(struct i2c_client *client) { int err; - if ((err = i2c_detach_client(client))) { - dev_err(&client->dev, - "Client deregistration failed, client not detached.\n"); + if ((err = i2c_detach_client(client))) return err; - } kfree(i2c_get_clientdata(client)); return 0; diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c index 225b512d..7fce0fc 100644 --- a/drivers/i2c/chips/pcf8591.c +++ b/drivers/i2c/chips/pcf8591.c @@ -240,11 +240,8 @@ static int pcf8591_detach_client(struct i2c_client *client) { int err; - if ((err = i2c_detach_client(client))) { - dev_err(&client->dev, - "Client deregistration failed, client not detached.\n"); + if ((err = i2c_detach_client(client))) return err; - } kfree(i2c_get_clientdata(client)); return 0; diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 7a7837a..b0bceb2 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -449,8 +449,12 @@ int i2c_detach_client(struct i2c_client *client) struct i2c_adapter *adapter = client->adapter; int res = 0; - if ((client->flags & I2C_CLIENT_ALLOW_USE) && (client->usage_count > 0)) + if ((client->flags & I2C_CLIENT_ALLOW_USE) + && (client->usage_count > 0)) { + dev_warn(&client->dev, "Client [%s] still busy, " + "can't detach\n", client->name); return -EBUSY; + } if (adapter->client_unregister) { res = adapter->client_unregister(client); |