[MTD] [NAND] pxa3xx_nand: use resource_size instead of 'r->end - r->start + 1'
Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
e7f521636a
commit
b2ed368055
1 changed files with 3 additions and 3 deletions
|
@ -1118,14 +1118,14 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
|
||||||
goto fail_put_clk;
|
goto fail_put_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) {
|
if (r == NULL) {
|
||||||
dev_err(&pdev->dev, "failed to request memory resource\n");
|
dev_err(&pdev->dev, "failed to request memory resource\n");
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto fail_put_clk;
|
goto fail_put_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->mmio_base = ioremap(r->start, r->end - r->start + 1);
|
info->mmio_base = ioremap(r->start, resource_size(r));
|
||||||
if (info->mmio_base == NULL) {
|
if (info->mmio_base == NULL) {
|
||||||
dev_err(&pdev->dev, "ioremap() failed\n");
|
dev_err(&pdev->dev, "ioremap() failed\n");
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
|
@ -1174,7 +1174,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
|
||||||
fail_free_io:
|
fail_free_io:
|
||||||
iounmap(info->mmio_base);
|
iounmap(info->mmio_base);
|
||||||
fail_free_res:
|
fail_free_res:
|
||||||
release_mem_region(r->start, r->end - r->start + 1);
|
release_mem_region(r->start, resource_size(r));
|
||||||
fail_put_clk:
|
fail_put_clk:
|
||||||
clk_disable(info->clk);
|
clk_disable(info->clk);
|
||||||
clk_put(info->clk);
|
clk_put(info->clk);
|
||||||
|
|
Loading…
Reference in a new issue