]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: make sure gpiod_to_irq() returns negative on NULL desc
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 15 Jun 2016 20:57:38 +0000 (22:57 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 17 Jun 2016 16:12:07 +0000 (18:12 +0200)
commit33475911186d0cde85a8a0d6f5721cf62f43121d
treebf2edaee0bd70d92406b10e15d82ef80ea248389
parentfd60ef286dd7181e6ff65c6a0db8f7770c8b17eb
gpio: make sure gpiod_to_irq() returns negative on NULL desc

commit 2e30dd33e6414b5dd7cc3f00192d925ba481cdd8
("gpio: bail out silently on NULL descriptors")
doesn't work for gpiod_to_irq(): drivers assume that NULL
descriptors will give negative IRQ numbers in return.

It has been pointed out that returning 0 is NO_IRQ and that
drivers should be amended to treat this as an error, but that
is for the longer term: now let us repair the semantics.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Reported-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c