usb: uhci: Use platform_get_irq() to get the interrupt
authorRob Herring <robh@kernel.org>
Wed, 15 Dec 2021 22:52:03 +0000 (16:52 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Dec 2021 15:52:21 +0000 (16:52 +0100)
Accessing platform device resources directly has long been deprecated for
DT as IRQ resources may not be available at device creation time. Drivers
continuing to use static IRQ resources is blocking removing the static setup
from the DT core code.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211215225203.1991003-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/uhci-platform.c

index be9e9db7cad1048f75aab2c01eb994a5171a6577..b2049b47a08dde372a7544e3817c77cd874a58fc 100644 (file)
@@ -133,7 +133,11 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
                goto err_rmr;
        }
 
-       ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED);
+       ret = platform_get_irq(pdev, 0);
+       if (ret < 0)
+               goto err_clk;
+
+       ret = usb_add_hcd(hcd, ret, IRQF_SHARED);
        if (ret)
                goto err_clk;