Thread (10 messages) 10 messages, 5 authors, 2020-05-22

Re: [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()

From: Sergei Shtylyov <hidden>
Date: 2020-04-10 09:37:03
Also in: linux-usb, lkml

Hello!

On 10.04.2020 4:58, Tang Bin wrote:
quoted hunk ↗ jump to hunk
If the function "platform_get_irq()" failed, the negative value
returned will not be detected here, including "-EPROBE_DEFER", which
causes the application to fail to get the correct error message.
Thus it must be fixed.

Signed-off-by: Tang Bin <redacted>
Signed-off-by: Shengju Zhang <redacted>
---
  drivers/usb/gadget/udc/fsl_udc_core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index ec6eda426..60853ad10 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -2441,8 +2441,8 @@ static int fsl_udc_probe(struct platform_device *pdev)
  	udc_controller->max_ep = (dccparams & DCCPARAMS_DEN_MASK) * 2;
  
  	udc_controller->irq = platform_get_irq(pdev, 0);
-	if (!udc_controller->irq) {
    This check has always been wrong, doesn't account for real errors and
probe deferral...
-		ret = -ENODEV;
+	if (udc_controller->irq <= 0) {
    Note that platfrom_get_irq() no longer returns 0 on error.
+		ret = udc_controller->irq ? : -ENODEV;
  		goto err_iounmap;
  	}
MBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help