Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: axi-dmac: add a check for devm_regmap_init_mmio

The driver misses checking the result of devm_regmap_init_mmio().
Add a check to fix it.

Fixes: fc15be39a827 ("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>

authored by

Chuhong Yuan and committed by
Vinod Koul
a5b982af dda51089

+9 -1
+9 -1
drivers/dma/dma-axi-dmac.c
··· 830 830 struct dma_device *dma_dev; 831 831 struct axi_dmac *dmac; 832 832 struct resource *res; 833 + struct regmap *regmap; 833 834 int ret; 834 835 835 836 dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL); ··· 922 921 923 922 platform_set_drvdata(pdev, dmac); 924 923 925 - devm_regmap_init_mmio(&pdev->dev, dmac->base, &axi_dmac_regmap_config); 924 + regmap = devm_regmap_init_mmio(&pdev->dev, dmac->base, 925 + &axi_dmac_regmap_config); 926 + if (IS_ERR(regmap)) { 927 + ret = PTR_ERR(regmap); 928 + goto err_free_irq; 929 + } 926 930 927 931 return 0; 928 932 933 + err_free_irq: 934 + free_irq(dmac->irq, dmac); 929 935 err_unregister_of: 930 936 of_dma_controller_free(pdev->dev.of_node); 931 937 err_unregister_device: