usb: host: Do not check for 0 return after calling platform_get_irq()
authorRuan Jinjie <ruanjinjie@huawei.com>
Wed, 2 Aug 2023 03:12:36 +0000 (11:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Aug 2023 12:46:53 +0000 (14:46 +0200)
It is not possible for platform_get_irq() to return 0. Use the
return value from platform_get_irq().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Justin Chen <justin.chen@broadcom.com>
Link: https://lore.kernel.org/r/20230802031236.2272196-1-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-atmel.c
drivers/usb/host/ehci-brcm.c
drivers/usb/host/ehci-orion.c
drivers/usb/host/ehci-sh.c

index e14b66d848ee17cb6d4688c380b1daf6f266b643..6a6e1c510b2838dc59889cca11f7d217a9b077dc 100644 (file)
@@ -102,8 +102,8 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
        pr_debug("Initializing Atmel-SoC USB Host Controller\n");
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               retval = -ENODEV;
+       if (irq < 0) {
+               retval = irq;
                goto fail_create_hcd;
        }
 
index 0362a082abb459a38cc451eb9953c259d0456f92..77e42c739c5806c1da2ca052ce2a0c0888d4e0f4 100644 (file)
@@ -140,8 +140,8 @@ static int ehci_brcm_probe(struct platform_device *pdev)
                return err;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0)
-               return irq ? irq : -EINVAL;
+       if (irq < 0)
+               return irq;
 
        /* Hook the hub control routine to work around a bug */
        ehci_brcm_hc_driver.hub_control = ehci_brcm_hub_control;
index 54f74b45c4b10327766b76994d548adfab765e81..6c47ab0a491d5133c59539c93b4a33e39c9262ca 100644 (file)
@@ -218,8 +218,8 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
        pr_debug("Initializing Orion-SoC USB Host Controller\n");
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               err = -ENODEV;
+       if (irq < 0) {
+               err = irq;
                goto err;
        }
 
index 575c513f7ea0f111d08edacaa102b6bd68bb7faa..d31d9506e41ab0844cf04f5bbe1485972f8f62a4 100644 (file)
@@ -82,8 +82,8 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
                return -ENODEV;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               ret = -ENODEV;
+       if (irq < 0) {
+               ret = irq;
                goto fail_create_hcd;
        }