Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: chipidea: msm: Fix return value check in ci_hdrc_msm_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().

Fixes: 2fc305be364e ("usb: chipidea: msm: Mux over secondary phy at the
right time")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>

authored by

Wei Yongjun and committed by
Peter Chen
753dfd23 490b63e6

+2 -2
+2 -2
drivers/usb/chipidea/ci_hdrc_msm.c
··· 218 218 219 219 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 220 220 ci->base = devm_ioremap_resource(&pdev->dev, res); 221 - if (!ci->base) 222 - return -ENOMEM; 221 + if (IS_ERR(ci->base)) 222 + return PTR_ERR(ci->base); 223 223 224 224 ci->rcdev.owner = THIS_MODULE; 225 225 ci->rcdev.ops = &ci_hdrc_msm_reset_ops;