mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[PATCH] i2c: Rework client usage count, 3 of 3
Do not limit the usage count of i2c clients to 1. In other words, change the client usage count behavior from the old I2C_CLIENT_ALLOW_USE to the old I2C_CLIENT_ALLOW_MULTIPLE_USE. The rationale is that no driver actually needs the limiting behavior, and the unlimiting behavior is slightly easier to implement. Update the documentation to reflect this change. Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
cde7859bda
commit
cf02df7702
3 changed files with 2 additions and 8 deletions
|
|
@ -497,14 +497,9 @@ int i2c_use_client(struct i2c_client *client)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (client->usage_count > 0)
|
||||
goto busy;
|
||||
client->usage_count++;
|
||||
|
||||
return 0;
|
||||
busy:
|
||||
i2c_dec_use_client(client);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
int i2c_release_client(struct i2c_client *client)
|
||||
|
|
|
|||
Loading…
Reference in a new issue