diff mbox

Input: mpu3050 - add missing i2c_set_clientdata() in mpu3050_probe()

Message ID CAPgLHd-ujkwTBn=hUH6SxfhHpYHyGqvrkcyuRTFkXmWtqE2Zjg@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Nov. 11, 2013, 6:18 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add missing i2c_set_clientdata() in mpu3050_probe(), otherwise
calling i2c_get_clientdata() in mpu3050_remove() returns NULL.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/input/misc/mpu3050.c | 1 +
 1 file changed, 1 insertion(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dmitry Torokhov Nov. 11, 2013, 7:34 a.m. UTC | #1
On Mon, Nov 11, 2013 at 02:18:54PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add missing i2c_set_clientdata() in mpu3050_probe(), otherwise
> calling i2c_get_clientdata() in mpu3050_remove() returns NULL.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied, thank you.

> ---
>  drivers/input/misc/mpu3050.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
> index dce0d95..6983ffb 100644
> --- a/drivers/input/misc/mpu3050.c
> +++ b/drivers/input/misc/mpu3050.c
> @@ -383,6 +383,7 @@ static int mpu3050_probe(struct i2c_client *client,
>  
>  	pm_runtime_enable(&client->dev);
>  	pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY);
> +	i2c_set_clientdata(client, sensor);
>  
>  	return 0;
>  
>
diff mbox

Patch

diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
index dce0d95..6983ffb 100644
--- a/drivers/input/misc/mpu3050.c
+++ b/drivers/input/misc/mpu3050.c
@@ -383,6 +383,7 @@  static int mpu3050_probe(struct i2c_client *client,
 
 	pm_runtime_enable(&client->dev);
 	pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY);
+	i2c_set_clientdata(client, sensor);
 
 	return 0;