Skip to content

Commit

Permalink
dmaengine: axi-dmac: add a check for devm_regmap_init_mmio
Browse files Browse the repository at this point in the history
The driver misses checking the result of devm_regmap_init_mmio().
Add a check to fix it.

Fixes: fc15be3 ("dmaengine: axi-dmac: add regmap support")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20191209085711.16001-1-hslester96@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
WillLester authored and vinodkoul committed Dec 11, 2019
1 parent dda5108 commit a5b982a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/dma/dma-axi-dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
struct dma_device *dma_dev;
struct axi_dmac *dmac;
struct resource *res;
struct regmap *regmap;
int ret;

dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL);
Expand Down Expand Up @@ -921,10 +922,17 @@ static int axi_dmac_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, dmac);

devm_regmap_init_mmio(&pdev->dev, dmac->base, &axi_dmac_regmap_config);
regmap = devm_regmap_init_mmio(&pdev->dev, dmac->base,
&axi_dmac_regmap_config);
if (IS_ERR(regmap)) {
ret = PTR_ERR(regmap);
goto err_free_irq;
}

return 0;

err_free_irq:
free_irq(dmac->irq, dmac);
err_unregister_of:
of_dma_controller_free(pdev->dev.of_node);
err_unregister_device:
Expand Down

0 comments on commit a5b982a

Please sign in to comment.