drivers/ide/au1xxx-ide.c: use resource_size()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 23 Nov 2009 18:27:22 +0000 (10:27 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Nov 2009 18:27:22 +0000 (10:27 -0800)
Use resource_size() for {request/release}_mem_region and ioremap.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ide/au1xxx-ide.c

index 58121bd6c1152c62199cc3417713a8c7416c80d6..87cef0c440ad32f625fe7bd55e368b8a427afcf4 100644 (file)
@@ -532,14 +532,13 @@ static int au_ide_probe(struct platform_device *dev)
                goto out;
        }
 
-       if (!request_mem_region(res->start, res->end - res->start + 1,
-                               dev->name)) {
+       if (!request_mem_region(res->start, resource_size(res), dev->name)) {
                pr_debug("%s: request_mem_region failed\n", DRV_NAME);
                ret =  -EBUSY;
                goto out;
        }
 
-       ahwif->regbase = (u32)ioremap(res->start, res->end - res->start + 1);
+       ahwif->regbase = (u32)ioremap(res->start, resource_size(res));
        if (ahwif->regbase == 0) {
                ret = -ENOMEM;
                goto out;
@@ -575,7 +574,7 @@ static int au_ide_remove(struct platform_device *dev)
        iounmap((void *)ahwif->regbase);
 
        res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-       release_mem_region(res->start, res->end - res->start + 1);
+       release_mem_region(res->start, resource_size(res));
 
        return 0;
 }