]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
plat-mxc/pwm.c: use resource_size()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 6 Jun 2011 20:44:57 +0000 (13:44 -0700)
committerSascha Hauer <s.hauer@pengutronix.de>
Tue, 7 Jun 2011 11:05:51 +0000 (13:05 +0200)
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/plat-mxc/pwm.c

index 7a61ef8f471a49fd3ac0b67540f949cf13eaaa43..761c3c940a68cf84aa65e0bbaebd64e999b9ff9c 100644 (file)
@@ -214,14 +214,14 @@ static int __devinit mxc_pwm_probe(struct platform_device *pdev)
                goto err_free_clk;
        }
 
-       r = request_mem_region(r->start, r->end - r->start + 1, pdev->name);
+       r = request_mem_region(r->start, resource_size(r), pdev->name);
        if (r == NULL) {
                dev_err(&pdev->dev, "failed to request memory resource\n");
                ret = -EBUSY;
                goto err_free_clk;
        }
 
-       pwm->mmio_base = ioremap(r->start, r->end - r->start + 1);
+       pwm->mmio_base = ioremap(r->start, resource_size(r));
        if (pwm->mmio_base == NULL) {
                dev_err(&pdev->dev, "failed to ioremap() registers\n");
                ret = -ENODEV;
@@ -236,7 +236,7 @@ static int __devinit mxc_pwm_probe(struct platform_device *pdev)
        return 0;
 
 err_free_mem:
-       release_mem_region(r->start, r->end - r->start + 1);
+       release_mem_region(r->start, resource_size(r));
 err_free_clk:
        clk_put(pwm->clk);
 err_free:
@@ -260,7 +260,7 @@ static int __devexit mxc_pwm_remove(struct platform_device *pdev)
        iounmap(pwm->mmio_base);
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       release_mem_region(r->start, r->end - r->start + 1);
+       release_mem_region(r->start, resource_size(r));
 
        clk_put(pwm->clk);