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: Peng Wu <wupeng58@huawei.com>
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Clément Léger <clement.leger@bootlin.com>
Link: https://lore.kernel.org/r/20220628130920.49493-1-wupeng58@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Peng Wu 2022-06-28 13:09:20 +00:00 committed by Jakub Kicinski
parent 3ce7547e5b
commit 626af58bad
1 changed files with 2 additions and 2 deletions

View File

@ -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)