usb: gadget: fsl: Fix unsigned expression compared with zero in fsl_udc_probe

udc_controller->irq is "unsigned int" always >= 0, but platform_get_irq may
return little than zero. So "dc_controller->irq < 0" condition is never
accessible.

Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
This commit is contained in:
Ye Bin 2020-08-24 16:42:34 +08:00 committed by Felipe Balbi
parent 4eea21dc67
commit 87a2dfb136
1 changed files with 4 additions and 3 deletions

View File

@ -2439,11 +2439,12 @@ static int fsl_udc_probe(struct platform_device *pdev)
/* DEN is bidirectional ep number, max_ep doubles the number */
udc_controller->max_ep = (dccparams & DCCPARAMS_DEN_MASK) * 2;
udc_controller->irq = platform_get_irq(pdev, 0);
if (udc_controller->irq <= 0) {
ret = udc_controller->irq ? : -ENODEV;
ret = platform_get_irq(pdev, 0);
if (ret <= 0) {
ret = ret ? : -ENODEV;
goto err_iounmap;
}
udc_controller->irq = ret;
ret = request_irq(udc_controller->irq, fsl_udc_irq, IRQF_SHARED,
driver_name, udc_controller);