summaryrefslogtreecommitdiff
path: root/drivers/dma/dw
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-05-08 13:01:50 +0400
committerVinod Koul <vinod.koul@intel.com>2014-05-22 14:07:25 +0400
commit1222934e54b63752b4b1ad305d6a7f632a3ae46d (patch)
tree1202048315d5a25ffde4702756894152088f1d7d /drivers/dma/dw
parent8be4f523b48087765defd18483c66b268b3286e5 (diff)
downloadlinux-1222934e54b63752b4b1ad305d6a7f632a3ae46d.tar.xz
dmaengine: dw: check return code of dma_async_device_register()
dma_async_device_register() may return non-zero error code. In such case we have to follow error path. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw')
-rw-r--r--drivers/dma/dw/core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index d539019fbe60..a27ded53ab4f 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1659,13 +1659,17 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
dma_writel(dw, CFG, DW_CFG_DMA_EN);
+ err = dma_async_device_register(&dw->dma);
+ if (err)
+ goto err_dma_register;
+
dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
nr_channels);
- dma_async_device_register(&dw->dma);
-
return 0;
+err_dma_register:
+ free_irq(chip->irq, dw);
err_pdata:
clk_disable_unprepare(dw->clk);
return err;