2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 10:44:14 +08:00

omap: Use resource_size

Use the resource_size function instead of manually calculating the
resource size. This reduces the chance of introducing off-by-one errors
and actually fixes one in mailbox.c.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
Tobias Klauser 2009-11-10 18:55:19 -08:00 committed by Tony Lindgren
parent ee90732456
commit 6d13524209
2 changed files with 2 additions and 2 deletions

View File

@ -366,7 +366,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
if (r < 0)
goto out;
gpmc_cs_enable_mem(cs, res->start, res->end - res->start + 1);
gpmc_cs_enable_mem(cs, res->start, resource_size(res));
*base = res->start;
gpmc_cs_set_reserved(cs, 1);
out:

View File

@ -300,7 +300,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "invalid mem resource\n");
return -ENODEV;
}
mbox_base = ioremap(res->start, res->end - res->start);
mbox_base = ioremap(res->start, resource_size(res));
if (!mbox_base)
return -ENOMEM;