ASoC: Davinci: Use resource_size() helper function
This patch modifies the Davinci i2s and mcasp drivers to make use of the resource_size() helper function for readability. Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
36633237be
commit
d852f446b7
|
@ -658,7 +658,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1,
|
ioarea = request_mem_region(mem->start, resource_size(mem),
|
||||||
pdev->name);
|
pdev->name);
|
||||||
if (!ioarea) {
|
if (!ioarea) {
|
||||||
dev_err(&pdev->dev, "McBSP region already claimed\n");
|
dev_err(&pdev->dev, "McBSP region already claimed\n");
|
||||||
|
@ -731,7 +731,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
|
||||||
err_free_mem:
|
err_free_mem:
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
err_release_region:
|
err_release_region:
|
||||||
release_mem_region(mem->start, (mem->end - mem->start) + 1);
|
release_mem_region(mem->start, resource_size(mem));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -747,7 +747,7 @@ static int davinci_i2s_remove(struct platform_device *pdev)
|
||||||
dev->clk = NULL;
|
dev->clk = NULL;
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
release_mem_region(mem->start, (mem->end - mem->start) + 1);
|
release_mem_region(mem->start, resource_size(mem));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -868,7 +868,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
ioarea = request_mem_region(mem->start,
|
ioarea = request_mem_region(mem->start,
|
||||||
(mem->end - mem->start) + 1, pdev->name);
|
resource_size(mem), pdev->name);
|
||||||
if (!ioarea) {
|
if (!ioarea) {
|
||||||
dev_err(&pdev->dev, "Audio region already claimed\n");
|
dev_err(&pdev->dev, "Audio region already claimed\n");
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
|
@ -933,7 +933,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_release_region:
|
err_release_region:
|
||||||
release_mem_region(mem->start, (mem->end - mem->start) + 1);
|
release_mem_region(mem->start, resource_size(mem));
|
||||||
err_release_data:
|
err_release_data:
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
|
|
||||||
|
@ -951,7 +951,7 @@ static int davinci_mcasp_remove(struct platform_device *pdev)
|
||||||
dev->clk = NULL;
|
dev->clk = NULL;
|
||||||
|
|
||||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
release_mem_region(mem->start, (mem->end - mem->start) + 1);
|
release_mem_region(mem->start, resource_size(mem));
|
||||||
|
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue