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

net: socionext: 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
5bd5b564 8a54d4c2

+1 -3
+1 -3
drivers/net/ethernet/socionext/sni_ave.c
··· 1553 1553 struct ave_private *priv; 1554 1554 struct net_device *ndev; 1555 1555 struct device_node *np; 1556 - struct resource *res; 1557 1556 const void *mac_addr; 1558 1557 void __iomem *base; 1559 1558 const char *name; ··· 1575 1576 if (irq < 0) 1576 1577 return irq; 1577 1578 1578 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1579 - base = devm_ioremap_resource(dev, res); 1579 + base = devm_platform_ioremap_resource(pdev, 0); 1580 1580 if (IS_ERR(base)) 1581 1581 return PTR_ERR(base); 1582 1582