diff mbox series

[08/10] usb: host: ohci-nxp: fix deferred probing

Message ID 20211021191437.8737-9-s.shtylyov@omp.ru (mailing list archive)
State Superseded
Headers show
Series Fix deferred probing in the USB host/gadget drivers | expand

Commit Message

Sergey Shtylyov Oct. 21, 2021, 7:14 p.m. UTC
The driver overrides the error codes returned by platform_get_irq() to
-ENXIO for some strange reason, so if it returns -EPROBE_DEFER, the driver
will fail the probe permanently instead of the deferred probing. Switch to
propagating the error codes upstream...

Fixes: 60bbfc84b6d9 ("USB OHCI controller support for PNX4008")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/host/ohci-nxp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Zapolskiy Oct. 23, 2021, 6:48 p.m. UTC | #1
Hi Sergey,

On 10/21/21 10:14 PM, Sergey Shtylyov wrote:
> The driver overrides the error codes returned by platform_get_irq() to
> -ENXIO for some strange reason, so if it returns -EPROBE_DEFER, the driver
> will fail the probe permanently instead of the deferred probing. Switch to
> propagating the error codes upstream...
> 
> Fixes: 60bbfc84b6d9 ("USB OHCI controller support for PNX4008")

thank you for the change, it is correct per se, however the blamed commit id
is obviously invalid and must be fixed.

The driver has been added 6 years before introduction of the EPROBE_DEFER by
commit d1c3414c2a9d ("drivercore: Add driver probe deferral mechanism"), and
the mechanism in connection to getting an irq was added even later, presumably
in commit 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq"), but
please correct me here.

> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---
>   drivers/usb/host/ohci-nxp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
> index afb9c2fc85c3..2492f78da6f1 100644
> --- a/drivers/usb/host/ohci-nxp.c
> +++ b/drivers/usb/host/ohci-nxp.c
> @@ -212,7 +212,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
>   
>   	irq = platform_get_irq(pdev, 0);
>   	if (irq < 0) {
> -		ret = -ENXIO;
> +		ret = irq;
>   		goto fail_resource;
>   	}
>   	if (!irq) {
> 

After an expected correction of the blamed commit id is done:

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

--
Best wishes,
Vladimir
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
index afb9c2fc85c3..2492f78da6f1 100644
--- a/drivers/usb/host/ohci-nxp.c
+++ b/drivers/usb/host/ohci-nxp.c
@@ -212,7 +212,7 @@  static int ohci_hcd_nxp_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		ret = -ENXIO;
+		ret = irq;
 		goto fail_resource;
 	}
 	if (!irq) {