From: Tang Bin <tangbin@cmss.chinamobile.com>
To: leoyang.li@nxp.com, balbi@kernel.org, gregkh@linuxfoundation.org
Cc: Tang Bin <tangbin@cmss.chinamobile.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Markus.Elfring@web.de, linuxppc-dev@lists.ozlabs.org,
Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Subject: [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()
Date: Fri, 10 Apr 2020 09:58:32 +0800 [thread overview]
Message-ID: <20200410015832.8012-1-tangbin@cmss.chinamobile.com> (raw)
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
next reply other threads:[~2020-04-10 1:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 1:58 Tang Bin [this message]
2020-04-10 7:33 ` [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200410015832.8012-1-tangbin@cmss.chinamobile.com \
--to=tangbin@cmss.chinamobile.com \
--cc=Markus.Elfring@web.de \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=leoyang.li@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=zhangshengju@cmss.chinamobile.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox