Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 123bbcee authored by Shinya Kuribayashi's avatar Shinya Kuribayashi Committed by Greg Kroah-Hartman
Browse files

USB: gpio_vbus: use cached IRQ number for consistency with the probed one



gpio_vbus is designed to be able to get an IRQ number for VBUS change
interrupt either (1) through platform_get_resource(IORESOURCE_IRQ) or
(2) by processing gpio_to_irq(pdata->gpio_vbus), in probe() function.

On the other hand, gpio_vbus_set_peripheral() and gpio_vbus_remove()
are always doing gpio_to_irq(pdata->gpio_vbus) to get an IRQ number.

This is not just inconsistent, but also broken.  There is no guarantee
that an IRQ number obtained by platform_get_resource() is equal to
gpio_to_irq(pdata->gpio_vbus).

Cache an IRQ number in probe() function, and use it where necessary.

Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f9d973a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment