dmaengine: at_xdmac: Handle return value of clk_prepare_enable.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Mon, 7 Aug 2017 07:45:19 +0000 (13:15 +0530)
committerVinod Koul <vinod.koul@intel.com>
Mon, 21 Aug 2017 16:50:44 +0000 (22:20 +0530)
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/at_xdmac.c

index 6a3cf97..c00e392 100644 (file)
@@ -1883,8 +1883,11 @@ static int atmel_xdmac_resume(struct device *dev)
        struct at_xdmac_chan    *atchan;
        struct dma_chan         *chan, *_chan;
        int                     i;
+       int ret;
 
-       clk_prepare_enable(atxdmac->clk);
+       ret = clk_prepare_enable(atxdmac->clk);
+       if (ret)
+               return ret;
 
        /* Clear pending interrupts. */
        for (i = 0; i < atxdmac->dma.chancnt; i++) {