[PATCH] I2C: refactor message in i2c_detach_client
We could refactor the error message 34 different i2c drivers print if i2c_detach_client() fails in this function itself. Saves quite a few lines of code. Documentation is updated to reflect that change. Note that this patch should be applied after Rudolf Marek's w83792d patches. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1ff4e3065b
commit
7bef559455
@ -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);
|
||||
|
Reference in New Issue
Block a user