gpiolib: Respect error code of ->get_direction()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 3 Jul 2018 00:38:31 +0000 (03:38 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 9 Jul 2018 13:10:43 +0000 (15:10 +0200)
commit36b312792b97933dc07abe074f50941199bd357c
tree8824e31d156cf796ad2666a277af77617fa0e8bb
parentf8b52dd50ccdae7efc42ef54278f29d2f9d6cb36
gpiolib: Respect error code of ->get_direction()

In case we try to lock GPIO pin as IRQ when something going wrong
we print a misleading message.

Correct this by checking an error code from ->get_direction() in
gpiochip_lock_as_irq() and printing a corresponding message.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c