diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 9b9d808578b9..f75344ac4663 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -764,17 +764,33 @@ int i2c_detach_client(struct i2c_client *client) | |||
764 | } | 764 | } |
765 | EXPORT_SYMBOL(i2c_detach_client); | 765 | EXPORT_SYMBOL(i2c_detach_client); |
766 | 766 | ||
767 | int i2c_use_client(struct i2c_client *client) | 767 | /** |
768 | * i2c_use_client - increments the reference count of the i2c client structure | ||
769 | * @client: the client being referenced | ||
770 | * | ||
771 | * Each live reference to a client should be refcounted. The driver model does | ||
772 | * that automatically as part of driver binding, so that most drivers don't | ||
773 | * need to do this explicitly: they hold a reference until they're unbound | ||
774 | * from the device. | ||
775 | * | ||
776 | * A pointer to the client with the incremented reference counter is returned. | ||
777 | */ | ||
778 | struct i2c_client *i2c_use_client(struct i2c_client *client) | ||
768 | { | 779 | { |
769 | get_device(&client->dev); | 780 | get_device(&client->dev); |
770 | return 0; | 781 | return client; |
771 | } | 782 | } |
772 | EXPORT_SYMBOL(i2c_use_client); | 783 | EXPORT_SYMBOL(i2c_use_client); |
773 | 784 | ||
774 | int i2c_release_client(struct i2c_client *client) | 785 | /** |
786 | * i2c_release_client - release a use of the i2c client structure | ||
787 | * @client: the client being no longer referenced | ||
788 | * | ||
789 | * Must be called when a user of a client is finished with it. | ||
790 | */ | ||
791 | void i2c_release_client(struct i2c_client *client) | ||
775 | { | 792 | { |
776 | put_device(&client->dev); | 793 | put_device(&client->dev); |
777 | return 0; | ||
778 | } | 794 | } |
779 | EXPORT_SYMBOL(i2c_release_client); | 795 | EXPORT_SYMBOL(i2c_release_client); |
780 | 796 | ||