Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: soc_button_array - use gpio_is_valid()

gpio_keys will later use gpio_is_valid(). To match the actual
behavior, we should use it here too.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Benjamin Tissoires and committed by
Dmitry Torokhov
be8e7a7e 0e2b4458

+2 -1
+2 -1
drivers/input/misc/soc_button_array.c
··· 17 17 #include <linux/acpi.h> 18 18 #include <linux/gpio/consumer.h> 19 19 #include <linux/gpio_keys.h> 20 + #include <linux/gpio.h> 20 21 #include <linux/platform_device.h> 21 22 22 23 /* ··· 93 92 continue; 94 93 95 94 gpio = soc_button_lookup_gpio(&pdev->dev, info->acpi_index); 96 - if (gpio < 0) 95 + if (!gpio_is_valid(gpio)) 97 96 continue; 98 97 99 98 gpio_keys[n_buttons].type = info->event_type;