forked from Minki/linux
[ARM] pxa: use resource_size() in ssp.c
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
This commit is contained in:
parent
077de1ad5a
commit
c8ee5c6951
@ -115,7 +115,7 @@ static int __devinit ssp_probe(struct platform_device *pdev)
|
|||||||
goto err_free_clk;
|
goto err_free_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = request_mem_region(res->start, res->end - res->start + 1,
|
res = request_mem_region(res->start, resource_size(res),
|
||||||
pdev->name);
|
pdev->name);
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
dev_err(&pdev->dev, "failed to request memory resource\n");
|
dev_err(&pdev->dev, "failed to request memory resource\n");
|
||||||
@ -125,7 +125,7 @@ static int __devinit ssp_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
ssp->phys_base = res->start;
|
ssp->phys_base = res->start;
|
||||||
|
|
||||||
ssp->mmio_base = ioremap(res->start, res->end - res->start + 1);
|
ssp->mmio_base = ioremap(res->start, resource_size(res));
|
||||||
if (ssp->mmio_base == NULL) {
|
if (ssp->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;
|
||||||
@ -156,7 +156,7 @@ static int __devinit ssp_probe(struct platform_device *pdev)
|
|||||||
err_free_io:
|
err_free_io:
|
||||||
iounmap(ssp->mmio_base);
|
iounmap(ssp->mmio_base);
|
||||||
err_free_mem:
|
err_free_mem:
|
||||||
release_mem_region(res->start, res->end - res->start + 1);
|
release_mem_region(res->start, resource_size(res));
|
||||||
err_free_clk:
|
err_free_clk:
|
||||||
clk_put(ssp->clk);
|
clk_put(ssp->clk);
|
||||||
err_free:
|
err_free:
|
||||||
@ -176,7 +176,7 @@ static int __devexit ssp_remove(struct platform_device *pdev)
|
|||||||
iounmap(ssp->mmio_base);
|
iounmap(ssp->mmio_base);
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
release_mem_region(res->start, res->end - res->start + 1);
|
release_mem_region(res->start, resource_size(res));
|
||||||
|
|
||||||
clk_put(ssp->clk);
|
clk_put(ssp->clk);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user