diff options
author | Dejin Zheng <zhengdejin5@gmail.com> | 2020-04-19 20:02:53 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-20 12:18:13 -0700 |
commit | 92efe48e8fe2b6848ca56e14436c2b7d20c986d4 (patch) | |
tree | b6b236397eb32bb8080e5732dca0997a1fcdd811 /drivers/net/ethernet/dnet.c | |
parent | b66c9b8de22b666718c2fcb0ae84ce620f9b81c0 (diff) | |
download | linux-92efe48e8fe2b6848ca56e14436c2b7d20c986d4.tar.gz |
net: ethernet: dnet: convert to devm_platform_get_and_ioremap_resource
use devm_platform_get_and_ioremap_resource() to simplify code, which
contains platform_get_resource() and devm_ioremap_resource(), it also
get the resource for use by the following code.
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/dnet.c')
-rw-r--r-- | drivers/net/ethernet/dnet.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c index 057a508dd6e2..db98274501a0 100644 --- a/drivers/net/ethernet/dnet.c +++ b/drivers/net/ethernet/dnet.c @@ -776,8 +776,7 @@ static int dnet_probe(struct platform_device *pdev) spin_lock_init(&bp->lock); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - bp->regs = devm_ioremap_resource(&pdev->dev, res); + bp->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(bp->regs)) { err = PTR_ERR(bp->regs); goto err_out_free_dev; |