diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2021-06-05 20:25:15 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-07 13:05:37 -0700 |
commit | ec89c2b55dc798096c5c16af4ee0094ff6c8cb3b (patch) | |
tree | 32fee2880f59710b2c1daf73e29b22d4e7db047b /drivers/net/ethernet/xscale | |
parent | d402af20315c99d85c9310d6f7a00e5aca53e192 (diff) |
net: ethernet: ixp4xx_eth: 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/xscale')
-rw-r--r-- | drivers/net/ethernet/xscale/ixp4xx_eth.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 1ecceeb9700d..85c66af9e56d 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -1425,7 +1425,6 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct eth_plat_info *plat; struct net_device *ndev; - struct resource *res; struct port *port; int err; @@ -1482,10 +1481,7 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) port->id = plat->npe; /* Get the port resource and remap */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - port->regs = devm_ioremap_resource(dev, res); + port->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(port->regs)) return PTR_ERR(port->regs); |