Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1222934e authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 8be4f523
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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;