net: Fix return value about devm_platform_ioremap_resource()
When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d04322a0da
commit
ef24d6c3d6
@ -947,8 +947,11 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev)
|
||||
u32 id, rev;
|
||||
|
||||
addr = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(addr))
|
||||
return PTR_ERR(addr);
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (IS_ERR(addr) || irq < 0)
|
||||
if (irq < 0)
|
||||
return -EINVAL;
|
||||
|
||||
id = readl(addr + IFI_CANFD_IP_ID);
|
||||
|
@ -792,7 +792,7 @@ static int sun4ican_probe(struct platform_device *pdev)
|
||||
|
||||
addr = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(addr)) {
|
||||
err = -EBUSY;
|
||||
err = PTR_ERR(addr);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -609,7 +609,7 @@ static int b53_srab_probe(struct platform_device *pdev)
|
||||
|
||||
priv->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(priv->regs))
|
||||
return -ENOMEM;
|
||||
return PTR_ERR(priv->regs);
|
||||
|
||||
dev = b53_switch_alloc(&pdev->dev, &b53_srab_ops, priv);
|
||||
if (!dev)
|
||||
|
@ -1418,7 +1418,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
|
||||
|
||||
pep->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(pep->base)) {
|
||||
err = -ENOMEM;
|
||||
err = PTR_ERR(pep->base);
|
||||
goto err_netdev;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user