Input: drv260x - fix input device's parent assignment
authorJingkui Wang <jkwang@google.com>
Mon, 12 Dec 2016 21:51:46 +0000 (13:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Jan 2017 07:32:24 +0000 (08:32 +0100)
commitafd2a1994ea4e37fb602410b350827d5909714fe
tree735359972d29f8700336f0f8cf793b3cc5ed57c2
parente5d92c0c84f3b821c65210ab20bb4583879a03c9
Input: drv260x - fix input device's parent assignment

commit 5a8a6b89c15766446d845671d574a9243b6d8786 upstream.

We were assigning I2C bus controller instead of client as parent device.
Besides being logically wrong, it messed up with devm handling of input
device. As a result we were leaving input device and event node behind
after rmmod-ing the driver, which lead to a kernel oops if one were to
access the event node later.

Let's remove the assignment and rely on devm_input_allocate_device() to
set it up properly for us.

Signed-off-by: Jingkui Wang <jkwang@google.com>
Fixes: 7132fe4f5687 ("Input: drv260x - add TI drv260x haptics driver")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/misc/drv260x.c