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>
This commit is contained in:
committed by
Tony Lindgren
parent
44e74840d6
commit
0fd92a15a0
@@ -116,7 +116,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
|
|||||||
if (!res)
|
if (!res)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
mem = request_mem_region(res->start, res->end - res->start + 1,
|
mem = request_mem_region(res->start, resource_size(res),
|
||||||
pdev->name);
|
pdev->name);
|
||||||
if (mem == NULL) {
|
if (mem == NULL) {
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
@@ -124,7 +124,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dev_set_drvdata(&pdev->dev, mem);
|
dev_set_drvdata(&pdev->dev, mem);
|
||||||
rng_base = ioremap(res->start, res->end - res->start + 1);
|
rng_base = ioremap(res->start, resource_size(res));
|
||||||
if (!rng_base) {
|
if (!rng_base) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_ioremap;
|
goto err_ioremap;
|
||||||
|
Reference in New Issue
Block a user