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

usb: fotg210: fix return value check in fotg210_probe()

devm_platform_get_and_ioremap_resource() never returns NULL pointer,
it will return ERR_PTR() when it fails, so replace the check with
IS_ERR().

Fixes: baef5330d35b ("usb: fotg210: Acquire memory resource in core")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230130120633.3342285-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Yang Yingliang and committed by
Greg Kroah-Hartman
21ef9c91 8cb9c36b

+2 -2
+2 -2
drivers/usb/fotg210/fotg210-core.c
··· 136 136 fotg->dev = dev; 137 137 138 138 fotg->base = devm_platform_get_and_ioremap_resource(pdev, 0, &fotg->res); 139 - if (!fotg->base) 140 - return -ENOMEM; 139 + if (IS_ERR(fotg->base)) 140 + return PTR_ERR(fotg->base); 141 141 142 142 fotg->pclk = devm_clk_get_optional_enabled(dev, "PCLK"); 143 143 if (IS_ERR(fotg->pclk))