[ARM] pxa: use resource_size() in pwm.c
Use resource_size for {request/release}_mem_region and ioremap. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
This commit is contained in:
parent
da2c3f0ead
commit
1692231cfd
|
@ -204,14 +204,14 @@ static int __devinit pwm_probe(struct platform_device *pdev)
|
||||||
goto err_free_clk;
|
goto err_free_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = request_mem_region(r->start, r->end - r->start + 1, pdev->name);
|
r = request_mem_region(r->start, resource_size(r), pdev->name);
|
||||||
if (r == NULL) {
|
if (r == NULL) {
|
||||||
dev_err(&pdev->dev, "failed to request memory resource\n");
|
dev_err(&pdev->dev, "failed to request memory resource\n");
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto err_free_clk;
|
goto err_free_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
pwm->mmio_base = ioremap(r->start, r->end - r->start + 1);
|
pwm->mmio_base = ioremap(r->start, resource_size(r));
|
||||||
if (pwm->mmio_base == NULL) {
|
if (pwm->mmio_base == NULL) {
|
||||||
dev_err(&pdev->dev, "failed to ioremap() registers\n");
|
dev_err(&pdev->dev, "failed to ioremap() registers\n");
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
|
@ -241,7 +241,7 @@ static int __devinit pwm_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_free_mem:
|
err_free_mem:
|
||||||
release_mem_region(r->start, r->end - r->start + 1);
|
release_mem_region(r->start, resource_size(r));
|
||||||
err_free_clk:
|
err_free_clk:
|
||||||
clk_put(pwm->clk);
|
clk_put(pwm->clk);
|
||||||
err_free:
|
err_free:
|
||||||
|
@ -271,7 +271,7 @@ static int __devexit pwm_remove(struct platform_device *pdev)
|
||||||
iounmap(pwm->mmio_base);
|
iounmap(pwm->mmio_base);
|
||||||
|
|
||||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
release_mem_region(r->start, r->end - r->start + 1);
|
release_mem_region(r->start, resource_size(r));
|
||||||
|
|
||||||
clk_put(pwm->clk);
|
clk_put(pwm->clk);
|
||||||
kfree(pwm);
|
kfree(pwm);
|
||||||
|
|
Loading…
Reference in New Issue