提交 6d135242 编写于 作者: T Tobias Klauser 提交者: Tony Lindgren

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: NTobias Klauser <tklauser@distanz.ch>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 ee907324
...@@ -366,7 +366,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base) ...@@ -366,7 +366,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
if (r < 0) if (r < 0)
goto out; 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; *base = res->start;
gpmc_cs_set_reserved(cs, 1); gpmc_cs_set_reserved(cs, 1);
out: out:
......
...@@ -300,7 +300,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev) ...@@ -300,7 +300,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "invalid mem resource\n"); dev_err(&pdev->dev, "invalid mem resource\n");
return -ENODEV; return -ENODEV;
} }
mbox_base = ioremap(res->start, res->end - res->start); mbox_base = ioremap(res->start, resource_size(res));
if (!mbox_base) if (!mbox_base)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册