diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-05-08 05:01:50 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-05-22 06:07:25 -0400 |
commit | 1222934e54b63752b4b1ad305d6a7f632a3ae46d (patch) | |
tree | 1202048315d5a25ffde4702756894152088f1d7d /drivers/dma/dw | |
parent | 8be4f523b48087765defd18483c66b268b3286e5 (diff) |
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.c | 8 |
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) | |||
1659 | 1659 | ||
1660 | dma_writel(dw, CFG, DW_CFG_DMA_EN); | 1660 | dma_writel(dw, CFG, DW_CFG_DMA_EN); |
1661 | 1661 | ||
1662 | err = dma_async_device_register(&dw->dma); | ||
1663 | if (err) | ||
1664 | goto err_dma_register; | ||
1665 | |||
1662 | dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n", | 1666 | dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n", |
1663 | nr_channels); | 1667 | nr_channels); |
1664 | 1668 | ||
1665 | dma_async_device_register(&dw->dma); | ||
1666 | |||
1667 | return 0; | 1669 | return 0; |
1668 | 1670 | ||
1671 | err_dma_register: | ||
1672 | free_irq(chip->irq, dw); | ||
1669 | err_pdata: | 1673 | err_pdata: |
1670 | clk_disable_unprepare(dw->clk); | 1674 | clk_disable_unprepare(dw->clk); |
1671 | return err; | 1675 | return err; |