[PATCH] i2c: Rework client usage count, 1 of 3
No i2c client uses the I2C_CLIENT_ALLOW_MULTIPLE_USE flag, drop it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
5d7b851dcc
commit
cb748fb201
2 changed files with 1 additions and 5 deletions
|
@ -500,9 +500,7 @@ int i2c_use_client(struct i2c_client *client)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (client->flags & I2C_CLIENT_ALLOW_USE) {
|
if (client->flags & I2C_CLIENT_ALLOW_USE) {
|
||||||
if (client->flags & I2C_CLIENT_ALLOW_MULTIPLE_USE)
|
if (client->usage_count > 0)
|
||||||
client->usage_count++;
|
|
||||||
else if (client->usage_count > 0)
|
|
||||||
goto busy;
|
goto busy;
|
||||||
else
|
else
|
||||||
client->usage_count++;
|
client->usage_count++;
|
||||||
|
|
|
@ -251,8 +251,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
|
||||||
|
|
||||||
/*flags for the client struct: */
|
/*flags for the client struct: */
|
||||||
#define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */
|
#define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */
|
||||||
#define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */
|
|
||||||
/* on an i2c_client */
|
|
||||||
#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
|
#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
|
||||||
#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
|
#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
|
||||||
/* Must equal I2C_M_TEN below */
|
/* Must equal I2C_M_TEN below */
|
||||||
|
|
Loading…
Reference in a new issue