HID: i2c-hid: Do not fail probing if gpiolib is not enabled
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 14 Apr 2015 14:35:12 +0000 (17:35 +0300)
committerJiri Kosina <jkosina@suse.cz>
Thu, 23 Apr 2015 08:58:16 +0000 (10:58 +0200)
commita7d2bf25a4837e6514a2747380fd4539b63ee20c
tree2f98331463789ca975c0b4bc812344a6214bde56
parent8de29a35dc840a05e451ad035bcb06e21ccf605f
HID: i2c-hid: Do not fail probing if gpiolib is not enabled

Using GPIOs and gpiolib is optional. If the kernel is compiled without GPIO
support the driver should not fail if it finds the interrupt using normal
methods.

However, commit a485923efbb8 ("HID: i2c-hid: Add support for ACPI GPIO
interrupts") did not take into account that acpi_dev_add_driver_gpios()
returns -ENXIO when !CONFIG_GPIOLIB.

Fix this by checking the return value against -ENXIO and 0 and only in that
case fail the probe.

Reported-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid.c