Hello.
On 16-12-2010 12:16, Vaibhav Bedia wrote:
This patch modifies the Davinci i2s and mcasp drivers to use ioremap()
instead of IO_ADDRESS
Signed-off-by: Vaibhav Bedia<[email protected]>
[...]
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 9e0e565..5395fad 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -694,7 +694,12 @@ static int davinci_i2s_probe(struct platform_device *pdev)
}
clk_enable(dev->clk);
- dev->base = (void __iomem *)IO_ADDRESS(mem->start);
+ dev->base = ioremap(mem->start, resource_size(mem));
+ if (!dev->base) {
+ dev_err(&pdev->dev, "ioremap failed\n");
+ ret = -ENOMEM;
+ goto err_ioremap;
Why iounmap() what you've just failed to ioremap()?
@@ -724,10 +729,12 @@ static int davinci_i2s_probe(struct platform_device *pdev)
[...]
+err_ioremap:
+ iounmap(dev->base);
err_free_mem:
Don't you forget to call clk_disable()/clk_put()?
kfree(dev);
err_release_region:
diff --git a/sound/soc/davinci/davinci-mcasp.c
b/sound/soc/davinci/davinci-mcasp.c
index fb55d2c..de61b41 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -885,7 +885,13 @@ static int davinci_mcasp_probe(struct platform_device
*pdev)
clk_enable(dev->clk);
dev->clk_active = 1;
- dev->base = (void __iomem *)IO_ADDRESS(mem->start);
+ dev->base = ioremap(mem->start, resource_size(mem));
+ if (!dev->base) {
+ dev_err(&pdev->dev, "ioremap failed\n");
+ ret = -ENOMEM;
+ goto err_ioremap;
Why iounmap() what you've just failed to ioremap()?
@@ -929,9 +935,11 @@ static int davinci_mcasp_probe(struct platform_device
*pdev)
[...]
+err_ioremap:
+ iounmap(dev->base);
err_release_region:
Don't you forget to call clk_disable()/clk_put()?
release_mem_region(mem->start, (mem->end - mem->start) + 1);
err_release_data:
WBR, Sergei
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source