Skip to content

Commit

Permalink
Input: mma8450 - add missing i2c_set_clientdata() in mma8450_probe()
Browse files Browse the repository at this point in the history
Add missing i2c_set_clientdata() in mma8450_probe(), otherwise
calling i2c_get_clientdata() in mma8450_remove() returns NULL.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Wei Yongjun authored and Dmitry Torokhov committed Nov 11, 2013
1 parent 158baef commit acc8466
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/misc/mma8450.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static void mma8450_close(struct input_polled_dev *dev)
* I2C init/probing/exit functions
*/
static int mma8450_probe(struct i2c_client *c,
const struct i2c_device_id *id)
const struct i2c_device_id *id)
{
struct input_polled_dev *idev;
struct mma8450 *m;
Expand Down Expand Up @@ -204,6 +204,8 @@ static int mma8450_probe(struct i2c_client *c,
goto err_free_mem;
}

i2c_set_clientdata(c, m);

return 0;

err_free_mem:
Expand Down

0 comments on commit acc8466

Please sign in to comment.