]> git.baikalelectronics.ru Git - kernel.git/commit
usb: host: ohci-at91: fix request of irq for optional gpio
authorTudor.Ambarus@microchip.com <Tudor.Ambarus@microchip.com>
Mon, 15 Oct 2018 09:00:54 +0000 (09:00 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Oct 2018 13:57:29 +0000 (15:57 +0200)
commit9889b78b282e6224ba1ee3bb5930163b970b91c5
tree3df13852edd9c4ef87e514630a9f517ed3ccb4dc
parentd9f08e9d99cb713d396024202c34e64bdb06a583
usb: host: ohci-at91: fix request of irq for optional gpio

atmel,oc-gpio is optional. Request its irq only when atmel,oc is set
in device tree.

devm_gpiod_get_index_optional returns NULL if -ENOENT. Check its
return value for NULL before error, because it is more probable that
atmel,oc is not set.

This fixes the following errors on boards where atmel,oc is not set in
device tree:
[    0.960000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ
[    0.960000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ
[    0.970000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-at91.c