Commit 42cc6886 authored by Wei Yongjun's avatar Wei Yongjun Committed by Felipe Balbi

usb: gadget: udc: lpc32xx: fix return value check in lpc32xx_udc_probe()

In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

This issue was detected by using the Coccinelle software.

Fixes: 408b56ca ("usb: gadget: udc: lpc32xx: simplify probe")
Acked-by: default avatarSylvain Lemieux <slemieux.tyco@gmail.com>
Acked-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 066cfd07
...@@ -3069,9 +3069,9 @@ static int lpc32xx_udc_probe(struct platform_device *pdev) ...@@ -3069,9 +3069,9 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
} }
udc->udp_baseaddr = devm_ioremap_resource(dev, res); udc->udp_baseaddr = devm_ioremap_resource(dev, res);
if (!udc->udp_baseaddr) { if (IS_ERR(udc->udp_baseaddr)) {
dev_err(udc->dev, "IO map failure\n"); dev_err(udc->dev, "IO map failure\n");
return -ENOMEM; return PTR_ERR(udc->udp_baseaddr);
} }
/* Get USB device clock */ /* Get USB device clock */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment