diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2021-06-10 15:29:33 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-10 13:53:13 -0700 |
commit | 0b462d017caff780f4922872c7098b193feee8b6 (patch) | |
tree | ba90c4a7c1270fd329596f20816c1f1f5bab76d7 /drivers/net/ethernet/wiznet/w5100.c | |
parent | d2ca24ee9fd83666538c189330a07b90bbcf58b3 (diff) | |
download | linux-stable-0b462d017caff780f4922872c7098b193feee8b6.tar.gz linux-stable-0b462d017caff780f4922872c7098b193feee8b6.tar.bz2 linux-stable-0b462d017caff780f4922872c7098b193feee8b6.zip |
net: w5100: Use devm_platform_get_and_ioremap_resource()
Use devm_platform_get_and_ioremap_resource() to simplify
code.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/wiznet/w5100.c')
-rw-r--r-- | drivers/net/ethernet/wiznet/w5100.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c index ec5db481c9cd..811815f8cd3b 100644 --- a/drivers/net/ethernet/wiznet/w5100.c +++ b/drivers/net/ethernet/wiznet/w5100.c @@ -263,19 +263,14 @@ static int w5100_writebulk_direct(struct net_device *ndev, u32 addr, static int w5100_mmio_init(struct net_device *ndev) { struct platform_device *pdev = to_platform_device(ndev->dev.parent); - struct w5100_priv *priv = netdev_priv(ndev); struct w5100_mmio_priv *mmio_priv = w5100_mmio_priv(ndev); - struct resource *mem; spin_lock_init(&mmio_priv->reg_lock); - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mmio_priv->base = devm_ioremap_resource(&pdev->dev, mem); + mmio_priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(mmio_priv->base)) return PTR_ERR(mmio_priv->base); - netdev_info(ndev, "at 0x%llx irq %d\n", (u64)mem->start, priv->irq); - return 0; } |