Skip to content

Commit

Permalink
mtd: davinci_nand.c: use resource_size()
Browse files Browse the repository at this point in the history
The ioremap'ed sizes are off by 1; use resource_size() for correct value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
H Hartley Sweeten authored and David Woodhouse committed Dec 31, 2009
1 parent 440d4f9 commit d8bc555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/nand/davinci_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,8 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
goto err_nomem;
}

vaddr = ioremap(res1->start, res1->end - res1->start);
base = ioremap(res2->start, res2->end - res2->start);
vaddr = ioremap(res1->start, resource_size(res1));
base = ioremap(res2->start, resource_size(res2));
if (!vaddr || !base) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -EINVAL;
Expand Down

0 comments on commit d8bc555

Please sign in to comment.