Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: b53: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

YueHaibing and committed by
David S. Miller
291f4b6d 6551c8c8

+2 -6
+2 -6
drivers/net/dsa/b53/b53_srab.c
··· 536 536 struct b53_device *dev = platform_get_drvdata(pdev); 537 537 struct b53_srab_priv *priv = dev->priv; 538 538 struct b53_srab_port_priv *p; 539 - struct resource *r; 540 539 unsigned int port; 541 540 u32 reg, off = 0; 542 541 int ret; ··· 543 544 if (dev->pdata && dev->pdata->chip_id != BCM58XX_DEVICE_ID) 544 545 return; 545 546 546 - r = platform_get_resource(pdev, IORESOURCE_MEM, 1); 547 - priv->mux_config = devm_ioremap_resource(&pdev->dev, r); 547 + priv->mux_config = devm_platform_ioremap_resource(pdev, 1); 548 548 if (IS_ERR(priv->mux_config)) 549 549 return; 550 550 ··· 591 593 const struct of_device_id *of_id = NULL; 592 594 struct b53_srab_priv *priv; 593 595 struct b53_device *dev; 594 - struct resource *r; 595 596 596 597 if (dn) 597 598 of_id = of_match_node(b53_srab_of_match, dn); ··· 607 610 if (!priv) 608 611 return -ENOMEM; 609 612 610 - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 611 - priv->regs = devm_ioremap_resource(&pdev->dev, r); 613 + priv->regs = devm_platform_ioremap_resource(pdev, 0); 612 614 if (IS_ERR(priv->regs)) 613 615 return -ENOMEM; 614 616