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: baef5330d3
("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>
This commit is contained in:
parent
8cb9c36b81
commit
21ef9c91f0
|
@ -136,8 +136,8 @@ static int fotg210_probe(struct platform_device *pdev)
|
|||
fotg->dev = dev;
|
||||
|
||||
fotg->base = devm_platform_get_and_ioremap_resource(pdev, 0, &fotg->res);
|
||||
if (!fotg->base)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(fotg->base))
|
||||
return PTR_ERR(fotg->base);
|
||||
|
||||
fotg->pclk = devm_clk_get_optional_enabled(dev, "PCLK");
|
||||
if (IS_ERR(fotg->pclk))
|
||||
|
|
Loading…
Reference in New Issue