aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2009-09-24 19:23:18 -0400
committerTony Lindgren <tony@atomide.com>2009-09-24 19:23:18 -0400
commit0fd92a15a01e6a57c1bbc816c574ec135c1c482e (patch)
tree7a03c8a08c2e292315aa19f4d95957acca7996d2 /drivers/char
parent44e74840d668d23b65e22772828e2600641b6ab0 (diff)
omap: rng: Use resource_size instead of manual calculation
Use the resource_size function instead of manually calculating the resource size. This reduces the chance of introducing off-by-one-errors. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/omap-rng.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 00dd3de1be51..06aad0831c73 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -116,7 +116,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
116 if (!res) 116 if (!res)
117 return -ENOENT; 117 return -ENOENT;
118 118
119 mem = request_mem_region(res->start, res->end - res->start + 1, 119 mem = request_mem_region(res->start, resource_size(res),
120 pdev->name); 120 pdev->name);
121 if (mem == NULL) { 121 if (mem == NULL) {
122 ret = -EBUSY; 122 ret = -EBUSY;
@@ -124,7 +124,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
124 } 124 }
125 125
126 dev_set_drvdata(&pdev->dev, mem); 126 dev_set_drvdata(&pdev->dev, mem);
127 rng_base = ioremap(res->start, res->end - res->start + 1); 127 rng_base = ioremap(res->start, resource_size(res));
128 if (!rng_base) { 128 if (!rng_base) {
129 ret = -ENOMEM; 129 ret = -ENOMEM;
130 goto err_ioremap; 130 goto err_ioremap;