Skip to content

Commit

Permalink
s3cmci: use resource_size() instead of local macro
Browse files Browse the repository at this point in the history
Replace the local definition RESSIZE() with the standard resource_size()
call for getting the size of a struct resource.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ben Dooks authored and Linus Torvalds committed Oct 1, 2009
1 parent ef8745c commit da52a7c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/mmc/host/s3cmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ static const int dbgmap_debug = dbg_err | dbg_debug;
dev_dbg(&host->pdev->dev, args); \
} while (0)

#define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1)

static struct s3c2410_dma_client s3cmci_dma_client = {
.name = "s3c-mci",
};
Expand Down Expand Up @@ -1298,15 +1296,15 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
}

host->mem = request_mem_region(host->mem->start,
RESSIZE(host->mem), pdev->name);
resource_size(host->mem), pdev->name);

if (!host->mem) {
dev_err(&pdev->dev, "failed to request io memory region.\n");
ret = -ENOENT;
goto probe_free_host;
}

host->base = ioremap(host->mem->start, RESSIZE(host->mem));
host->base = ioremap(host->mem->start, resource_size(host->mem));
if (!host->base) {
dev_err(&pdev->dev, "failed to ioremap() io memory region.\n");
ret = -EINVAL;
Expand Down Expand Up @@ -1433,7 +1431,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
iounmap(host->base);

probe_free_mem_region:
release_mem_region(host->mem->start, RESSIZE(host->mem));
release_mem_region(host->mem->start, resource_size(host->mem));

probe_free_host:
mmc_free_host(mmc);
Expand Down Expand Up @@ -1469,7 +1467,7 @@ static int __devexit s3cmci_remove(struct platform_device *pdev)
free_irq(host->irq, host);

iounmap(host->base);
release_mem_region(host->mem->start, RESSIZE(host->mem));
release_mem_region(host->mem->start, resource_size(host->mem));

mmc_free_host(mmc);
return 0;
Expand Down

0 comments on commit da52a7c

Please sign in to comment.