Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751542AbdHPGUi (ORCPT ); Wed, 16 Aug 2017 02:20:38 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:10297 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbdHPGUh (ORCPT ); Wed, 16 Aug 2017 02:20:37 -0400 X-IronPort-AV: E=Sophos;i="5.41,381,1498546800"; d="scan'208";a="3712501" Date: Wed, 16 Aug 2017 08:19:06 +0200 From: Ludovic Desroches To: Arvind Yadav CC: , , , , , Subject: Re: [PATCH 2/2] dmaengine: at_xdmac: Handle return value of clk_prepare_enable. Message-ID: <20170816061906.c3q52ummmungnweo@rfolt0960.corp.atmel.com> Mail-Followup-To: Arvind Yadav , dan.j.williams@intel.com, vinod.koul@intel.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org References: <878f9486ee507c227cb8835417c520b489c768c8.1502091778.git.arvind.yadav.cs@gmail.com> <3c5d3448f8d00995698e2dd905ba0d11a645b35f.1502091778.git.arvind.yadav.cs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <3c5d3448f8d00995698e2dd905ba0d11a645b35f.1502091778.git.arvind.yadav.cs@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 911 Lines: 31 On Mon, Aug 07, 2017 at 01:15:19PM +0530, Arvind Yadav wrote: > clk_prepare_enable() can fail here and we must check its return value. > > Signed-off-by: Arvind Yadav Acked-by: Ludovic Desroches Thanks > --- > drivers/dma/at_xdmac.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c > index 6a3cf97..c00e392 100644 > --- a/drivers/dma/at_xdmac.c > +++ b/drivers/dma/at_xdmac.c > @@ -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++) { > -- > 1.9.1 >