From: Ding Xiang Date: Mon, 29 Jul 2019 09:01:22 +0000 (+0800) Subject: net: ag71xx: use resource_size for the ioremap size X-Git-Tag: v5.4-rc1~131^2~340 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c51ab067c5312695331129806cb9a42791903305;p=platform%2Fkernel%2Flinux-rpi.git net: ag71xx: use resource_size for the ioremap size use resource_size to calcuate ioremap size and make the code simpler. Signed-off-by: Ding Xiang Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index 8b69d0d..77542bd 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -1686,7 +1686,7 @@ static int ag71xx_probe(struct platform_device *pdev) } ag->mac_base = devm_ioremap_nocache(&pdev->dev, res->start, - res->end - res->start + 1); + resource_size(res)); if (!ag->mac_base) { err = -ENOMEM; goto err_free;