summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2016-07-19 11:13:17 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-07-19 11:42:44 -0700
commit3746e5675211104844310a918fc2bf583f4a01b4 (patch)
tree0ba9910f2228c5ce70193dc9c2309275c52c1cbf /drivers/input
parentae10850c5cf27c03bf89dc2ee113c61c4d98a854 (diff)
downloadlinux-stable-3746e5675211104844310a918fc2bf583f4a01b4.tar.gz
linux-stable-3746e5675211104844310a918fc2bf583f4a01b4.tar.bz2
linux-stable-3746e5675211104844310a918fc2bf583f4a01b4.zip
Input: wacom_w8001 - handle errors from input_mt_init_slots()
input_mt_init_slots() may fail and we should be handling failures properly. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/wacom_w8001.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index c1dac8628817..85e95725d0df 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -518,7 +518,13 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename,
w8001->pktlen = W8001_PKTLEN_TOUCH2FG;
__set_bit(BTN_TOOL_DOUBLETAP, dev->keybit);
- input_mt_init_slots(dev, 2, 0);
+ error = input_mt_init_slots(dev, 2, 0);
+ if (error) {
+ dev_err(&w8001->serio->dev,
+ "failed to initialize MT slots: %d\n", error);
+ return error;
+ }
+
input_set_abs_params(dev, ABS_MT_POSITION_X,
0, touch.x, 0, 0);
input_set_abs_params(dev, ABS_MT_POSITION_Y,