diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2012-01-12 04:55:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-01-30 22:24:02 -0500 |
commit | 7bec78e0a82418021dc2e63dea4d2b749953086d (patch) | |
tree | 6fe78c7efc79dc4265d01bc9d57a06ad7674ffff /drivers/dma/pl330.c | |
parent | 2b4f130e05cb28a9794921aad5139615e94a7b02 (diff) |
drivers/dma/pl330.c: add missing iounmap
Add missing iounmap in error handling code, in a case where the function
already preforms iounmap on some other execution path.
This patch additionally adds calls to clk_disable and clk_put.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e;
statement S,S1;
int ret;
@@
e = \(ioremap\|ioremap_nocache\)(...)
... when != iounmap(e)
if (<+...e...+>) S
... when any
when != iounmap(e)
*if (...)
{ ... when != iounmap(e)
return ...; }
... when any
iounmap(e);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/pl330.c')
-rw-r--r-- | drivers/dma/pl330.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index b8ec03ee8e22..84ebea9bc53a 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -829,7 +829,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
829 | if (IS_ERR(pdmac->clk)) { | 829 | if (IS_ERR(pdmac->clk)) { |
830 | dev_err(&adev->dev, "Cannot get operation clock.\n"); | 830 | dev_err(&adev->dev, "Cannot get operation clock.\n"); |
831 | ret = -EINVAL; | 831 | ret = -EINVAL; |
832 | goto probe_err1; | 832 | goto probe_err2; |
833 | } | 833 | } |
834 | 834 | ||
835 | amba_set_drvdata(adev, pdmac); | 835 | amba_set_drvdata(adev, pdmac); |
@@ -843,11 +843,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
843 | ret = request_irq(irq, pl330_irq_handler, 0, | 843 | ret = request_irq(irq, pl330_irq_handler, 0, |
844 | dev_name(&adev->dev), pi); | 844 | dev_name(&adev->dev), pi); |
845 | if (ret) | 845 | if (ret) |
846 | goto probe_err2; | 846 | goto probe_err3; |
847 | 847 | ||
848 | ret = pl330_add(pi); | 848 | ret = pl330_add(pi); |
849 | if (ret) | 849 | if (ret) |
850 | goto probe_err3; | 850 | goto probe_err4; |
851 | 851 | ||
852 | INIT_LIST_HEAD(&pdmac->desc_pool); | 852 | INIT_LIST_HEAD(&pdmac->desc_pool); |
853 | spin_lock_init(&pdmac->pool_lock); | 853 | spin_lock_init(&pdmac->pool_lock); |
@@ -904,7 +904,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
904 | ret = dma_async_device_register(pd); | 904 | ret = dma_async_device_register(pd); |
905 | if (ret) { | 905 | if (ret) { |
906 | dev_err(&adev->dev, "unable to register DMAC\n"); | 906 | dev_err(&adev->dev, "unable to register DMAC\n"); |
907 | goto probe_err4; | 907 | goto probe_err5; |
908 | } | 908 | } |
909 | 909 | ||
910 | dev_info(&adev->dev, | 910 | dev_info(&adev->dev, |
@@ -917,10 +917,15 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
917 | 917 | ||
918 | return 0; | 918 | return 0; |
919 | 919 | ||
920 | probe_err4: | 920 | probe_err5: |
921 | pl330_del(pi); | 921 | pl330_del(pi); |
922 | probe_err3: | 922 | probe_err4: |
923 | free_irq(irq, pi); | 923 | free_irq(irq, pi); |
924 | probe_err3: | ||
925 | #ifndef CONFIG_PM_RUNTIME | ||
926 | clk_disable(pdmac->clk); | ||
927 | #endif | ||
928 | clk_put(pdmac->clk); | ||
924 | probe_err2: | 929 | probe_err2: |
925 | iounmap(pi->base); | 930 | iounmap(pi->base); |
926 | probe_err1: | 931 | probe_err1: |