mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
i2c: Change prototypes of refcounting functions
Use more standard prototypes for i2c_use_client() and i2c_release_client(). The former now returns a pointer to the client, and the latter no longer returns anything. This matches what all other subsystems do. Signed-off-by: Jean Delvare <[email protected]> Cc: David Brownell <[email protected]>
This commit is contained in:
parent
bdc511f438
commit
e48d33193d
3 changed files with 26 additions and 27 deletions
|
|
@ -764,17 +764,33 @@ int i2c_detach_client(struct i2c_client *client)
|
|||
}
|
||||
EXPORT_SYMBOL(i2c_detach_client);
|
||||
|
||||
int i2c_use_client(struct i2c_client *client)
|
||||
/**
|
||||
* i2c_use_client - increments the reference count of the i2c client structure
|
||||
* @client: the client being referenced
|
||||
*
|
||||
* Each live reference to a client should be refcounted. The driver model does
|
||||
* that automatically as part of driver binding, so that most drivers don't
|
||||
* need to do this explicitly: they hold a reference until they're unbound
|
||||
* from the device.
|
||||
*
|
||||
* A pointer to the client with the incremented reference counter is returned.
|
||||
*/
|
||||
struct i2c_client *i2c_use_client(struct i2c_client *client)
|
||||
{
|
||||
get_device(&client->dev);
|
||||
return 0;
|
||||
return client;
|
||||
}
|
||||
EXPORT_SYMBOL(i2c_use_client);
|
||||
|
||||
int i2c_release_client(struct i2c_client *client)
|
||||
/**
|
||||
* i2c_release_client - release a use of the i2c client structure
|
||||
* @client: the client being no longer referenced
|
||||
*
|
||||
* Must be called when a user of a client is finished with it.
|
||||
*/
|
||||
void i2c_release_client(struct i2c_client *client)
|
||||
{
|
||||
put_device(&client->dev);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(i2c_release_client);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue