提交 da52a7ca 编写于 作者: B Ben Dooks 提交者: Linus Torvalds

s3cmci: use resource_size() instead of local macro

Replace the local definition RESSIZE() with the standard resource_size()
call for getting the size of a struct resource.
Signed-off-by: NBen Dooks <ben@simtec.co.uk>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ef8745c1
...@@ -58,8 +58,6 @@ static const int dbgmap_debug = dbg_err | dbg_debug; ...@@ -58,8 +58,6 @@ static const int dbgmap_debug = dbg_err | dbg_debug;
dev_dbg(&host->pdev->dev, args); \ dev_dbg(&host->pdev->dev, args); \
} while (0) } while (0)
#define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1)
static struct s3c2410_dma_client s3cmci_dma_client = { static struct s3c2410_dma_client s3cmci_dma_client = {
.name = "s3c-mci", .name = "s3c-mci",
}; };
...@@ -1298,7 +1296,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) ...@@ -1298,7 +1296,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
} }
host->mem = request_mem_region(host->mem->start, host->mem = request_mem_region(host->mem->start,
RESSIZE(host->mem), pdev->name); resource_size(host->mem), pdev->name);
if (!host->mem) { if (!host->mem) {
dev_err(&pdev->dev, "failed to request io memory region.\n"); dev_err(&pdev->dev, "failed to request io memory region.\n");
...@@ -1306,7 +1304,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) ...@@ -1306,7 +1304,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
goto probe_free_host; 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) { if (!host->base) {
dev_err(&pdev->dev, "failed to ioremap() io memory region.\n"); dev_err(&pdev->dev, "failed to ioremap() io memory region.\n");
ret = -EINVAL; ret = -EINVAL;
...@@ -1433,7 +1431,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) ...@@ -1433,7 +1431,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
iounmap(host->base); iounmap(host->base);
probe_free_mem_region: 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: probe_free_host:
mmc_free_host(mmc); mmc_free_host(mmc);
...@@ -1469,7 +1467,7 @@ static int __devexit s3cmci_remove(struct platform_device *pdev) ...@@ -1469,7 +1467,7 @@ static int __devexit s3cmci_remove(struct platform_device *pdev)
free_irq(host->irq, host); free_irq(host->irq, host);
iounmap(host->base); 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); mmc_free_host(mmc);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册