diff options
author | Tang Bin <tangbin@cmss.chinamobile.com> | 2020-04-10 09:58:32 +0800 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-05-25 11:09:43 +0300 |
commit | 4cda340a455b425f7df9657aaaa78a75757d940d (patch) | |
tree | a2201349428bafd813b9ff029bedae6807815f93 /drivers/usb | |
parent | 44734a594196bf1d474212f38fe3a0d37a73278b (diff) | |
download | linux-4cda340a455b425f7df9657aaaa78a75757d940d.tar.gz |
usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()
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.
Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/udc/fsl_udc_core.c | 4 |
1 files 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 febabde62f71..b2638e83bb49 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2440,8 +2440,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; } |