]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
dmaengine: dw: check return code of dma_async_device_register()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 8 May 2014 09:01:50 +0000 (12:01 +0300)
committerVinod Koul <vinod.koul@intel.com>
Thu, 22 May 2014 10:07:25 +0000 (15:37 +0530)
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>
drivers/dma/dw/core.c

index d539019fbe6059fcc7b5296375dffe5aa611998a..a27ded53ab4f0e5eb2fa312e891da3adf8a49ef9 100644 (file)
@@ -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;