linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()
@ 2020-04-10  1:58 Tang Bin
  2020-04-10  7:33 ` Markus Elfring
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tang Bin @ 2020-04-10  1:58 UTC (permalink / raw)
  To: leoyang.li, balbi, gregkh
  Cc: Tang Bin, linux-usb, linux-kernel, Markus.Elfring, linuxppc-dev,
	Shengju Zhang

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 <tangbin@cmss.chinamobile.com>
Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
---
 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) {
-		ret = -ENODEV;
+	if (udc_controller->irq <= 0) {
+		ret = udc_controller->irq ? : -ENODEV;
 		goto err_iounmap;
 	}
 
-- 
2.20.1.windows.1




^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-22 22:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10  1:58 [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe() Tang Bin
2020-04-10  7:33 ` Markus Elfring
2020-04-10  8:05   ` Tang Bin
2020-04-10  8:30     ` Markus Elfring
2020-04-10  9:15       ` Tang Bin
2020-04-14  8:30     ` [PATCH] " Dan Carpenter
2020-04-14  9:13       ` Tang Bin
2020-05-22 22:40         ` Li Yang
2020-04-10  9:36 ` Sergei Shtylyov
2020-04-10  9:47 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).