Input: soc_button_array - bail out earlier if gpiod_count is zero
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Fri, 25 Nov 2016 19:36:01 +0000 (11:36 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 25 Nov 2016 19:39:50 +0000 (11:39 -0800)
commit3d5a9437a68a184fbbd0dcf09bf4daf40250505e
tree62881e1940d7d44f453f649fb7ee38dd0f4360ab
parentbe8e7a7ec876d509bc61af64b41b314a142aa262
Input: soc_button_array - bail out earlier if gpiod_count is zero

The PNP0C40 device of the Surface 3 doesn't have any GPIO attached to it.
Instead of trying to access the GPIO, request the count beforehand and
bail out if it is null or if an error is returned.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/soc_button_array.c