Commit 626af58b authored by Peng Wu's avatar Peng Wu Committed by Jakub Kicinski

net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe()

The devm_platform_ioremap_resource() function never returns NULL.
It returns error pointers.
Signed-off-by: default avatarPeng Wu <wupeng58@huawei.com>
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Reviewed-by: default avatarClément Léger <clement.leger@bootlin.com>
Link: https://lore.kernel.org/r/20220628130920.49493-1-wupeng58@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3ce7547e
......@@ -946,8 +946,8 @@ static int a5psw_probe(struct platform_device *pdev)
mutex_init(&a5psw->lk_lock);
spin_lock_init(&a5psw->reg_lock);
a5psw->base = devm_platform_ioremap_resource(pdev, 0);
if (!a5psw->base)
return -EINVAL;
if (IS_ERR(a5psw->base))
return PTR_ERR(a5psw->base);
ret = a5psw_pcs_get(a5psw);
if (ret)
......
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