From d852f446b71b80c59821a08cdb595aa266210daf Mon Sep 17 00:00:00 2001 From: Vaibhav Bedia Date: Wed, 9 Feb 2011 18:39:52 +0530 Subject: [PATCH] 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 Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/davinci/davinci-i2s.c | 6 +++--- sound/soc/davinci/davinci-mcasp.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index 9e0e565e6ed9..f8c8487aba55 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c @@ -658,7 +658,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) return -ENODEV; } - ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, + ioarea = request_mem_region(mem->start, resource_size(mem), pdev->name); if (!ioarea) { 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: kfree(dev); err_release_region: - release_mem_region(mem->start, (mem->end - mem->start) + 1); + release_mem_region(mem->start, resource_size(mem)); return ret; } @@ -747,7 +747,7 @@ static int davinci_i2s_remove(struct platform_device *pdev) dev->clk = NULL; kfree(dev); 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; } diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index fb55d2c5d704..9b5d5ca37a97 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -868,7 +868,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) } ioarea = request_mem_region(mem->start, - (mem->end - mem->start) + 1, pdev->name); + resource_size(mem), pdev->name); if (!ioarea) { dev_err(&pdev->dev, "Audio region already claimed\n"); ret = -EBUSY; @@ -933,7 +933,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) return 0; err_release_region: - release_mem_region(mem->start, (mem->end - mem->start) + 1); + release_mem_region(mem->start, resource_size(mem)); err_release_data: kfree(dev); @@ -951,7 +951,7 @@ static int davinci_mcasp_remove(struct platform_device *pdev) dev->clk = NULL; 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); -- 2.20.1