summaryrefslogtreecommitdiff
path: root/drivers/phy/sunplus
diff options
context:
space:
mode:
authorPeng Wu <wupeng58@huawei.com>2022-09-11 09:00:53 +0300
committerVinod Koul <vkoul@kernel.org>2022-11-04 21:59:57 +0300
commit6e59419fd0a244dd55e53e798797f0697dec8b1c (patch)
treec66b6b094942f85f2e1c4b4f7ff85a23d91b178f /drivers/phy/sunplus
parent04948e757148f870a31f4887ea2239403f516c3c (diff)
downloadlinux-6e59419fd0a244dd55e53e798797f0697dec8b1c.tar.xz
phy: sunplus: Fix an IS_ERR() vs NULL bug in sp_usb_phy_probe
The devm_ioremap() function returns NULL on error, it doesn't return error pointers. Fixes: 99d9ccd973852 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021") Signed-off-by: Peng Wu <wupeng58@huawei.com> Link: https://lore.kernel.org/r/20220911060053.123594-1-wupeng58@huawei.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy/sunplus')
-rw-r--r--drivers/phy/sunplus/phy-sunplus-usb2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/phy/sunplus/phy-sunplus-usb2.c b/drivers/phy/sunplus/phy-sunplus-usb2.c
index b932087c55b2..e827b79f6d49 100644
--- a/drivers/phy/sunplus/phy-sunplus-usb2.c
+++ b/drivers/phy/sunplus/phy-sunplus-usb2.c
@@ -256,8 +256,8 @@ static int sp_usb_phy_probe(struct platform_device *pdev)
usbphy->moon4_res_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "moon4");
usbphy->moon4_regs = devm_ioremap(&pdev->dev, usbphy->moon4_res_mem->start,
resource_size(usbphy->moon4_res_mem));
- if (IS_ERR(usbphy->moon4_regs))
- return PTR_ERR(usbphy->moon4_regs);
+ if (!usbphy->moon4_regs)
+ return -ENOMEM;
usbphy->phy_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(usbphy->phy_clk))