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

Commit e4499079 authored by Nicolas Ferre's avatar Nicolas Ferre
Browse files

ARM/USB: at91/ohci-at91: remove the use of irq_to_gpio



irq_to_gpio() macro will be removed from AT91 GPIO interrupt
controller. So we replace it with the use of gpio_to_irq()
and a reworked test.

Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-usb@vger.kernel.org
parent fe5e0796
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -448,11 +448,12 @@ static irqreturn_t ohci_hcd_at91_overcurrent_irq(int irq, void *data)


	/* From the GPIO notifying the over-current situation, find
	/* From the GPIO notifying the over-current situation, find
	 * out the corresponding port */
	 * out the corresponding port */
	gpio = irq_to_gpio(irq);
	for (port = 0; port < ARRAY_SIZE(pdata->overcurrent_pin); port++) {
	for (port = 0; port < ARRAY_SIZE(pdata->overcurrent_pin); port++) {
		if (pdata->overcurrent_pin[port] == gpio)
		if (gpio_to_irq(pdata->overcurrent_pin[port]) == irq) {
			gpio = pdata->overcurrent_pin[port];
			break;
			break;
		}
		}
	}


	if (port == ARRAY_SIZE(pdata->overcurrent_pin)) {
	if (port == ARRAY_SIZE(pdata->overcurrent_pin)) {
		dev_err(& pdev->dev, "overcurrent interrupt from unknown GPIO\n");
		dev_err(& pdev->dev, "overcurrent interrupt from unknown GPIO\n");