Skip to content

Commit

Permalink
dmaengine: dw: check return code of dma_async_device_register()
Browse files Browse the repository at this point in the history
dma_async_device_register() may return non-zero error code. In such case we
have to follow error path.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
andy-shev authored and Vinod Koul committed May 22, 2014
1 parent 8be4f52 commit 1222934
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/dma/dw/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1222934

Please sign in to comment.