net: ag71xx: use resource_size for the ioremap size
authorDing Xiang <dingxiang@cmss.chinamobile.com>
Mon, 29 Jul 2019 09:01:22 +0000 (17:01 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jul 2019 16:48:23 +0000 (09:48 -0700)
use resource_size to calcuate ioremap size and make
the code simpler.

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/atheros/ag71xx.c

index 8b69d0d..77542bd 100644 (file)
@@ -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;