Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752148AbbBKMDY (ORCPT ); Wed, 11 Feb 2015 07:03:24 -0500 Received: from mga02.intel.com ([134.134.136.20]:37092 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbbBKMDX (ORCPT ); Wed, 11 Feb 2015 07:03:23 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,558,1418112000"; d="scan'208";a="453088117" Message-ID: <1423656159.31903.502.camel@linux.intel.com> Subject: Re: [PATCH] dmaengine: dw: support for clockless platforms From: Andy Shevchenko To: Viresh Kumar Cc: Heikki Krogerus , Russell King , Vinod Koul , "linux-kernel@vger.kernel.org" , dmaengine@vger.kernel.org Date: Wed, 11 Feb 2015 14:02:39 +0200 In-Reply-To: References: <1421758677-183443-1-git-send-email-heikki.krogerus@linux.intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1863 Lines: 49 On Wed, 2015-02-11 at 10:10 +0800, Viresh Kumar wrote: > On Tue, Jan 20, 2015 at 8:57 PM, Heikki Krogerus > wrote: > > When requesting clock in the platform driver, leaving > > chip->clk value as NULL if -ENOENT is returned, and > > continue. With other errors returning failure. It makes the > > driver usable on platforms that do not provide the clock. > > > > Signed-off-by: Heikki Krogerus > > --- > > drivers/dma/dw/platform.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c > > index 32ea1ac..b183bc0 100644 > > --- a/drivers/dma/dw/platform.c > > +++ b/drivers/dma/dw/platform.c > > @@ -180,8 +180,12 @@ static int dw_probe(struct platform_device *pdev) > > chip->dev = dev; > > > > chip->clk = devm_clk_get(chip->dev, "hclk"); > > - if (IS_ERR(chip->clk)) > > - return PTR_ERR(chip->clk); > > + if (IS_ERR(chip->clk)) { > > + if (PTR_ERR(chip->clk) == -ENOENT) > > + chip->clk = NULL; > > This is wrong and reasons are mentioned in this thread: > > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/088437.html Thanks for the link. > > You don't need to set it to NULL, if CONFIG_HAVE_CLK isn't set > the dummy routines would take care of it. Yeah, but in our case we have CONFIG_HAVE_CLK=y and no clk is provided since IP is clockless. What could you suggest to do in such case? -- Andy Shevchenko Intel Finland Oy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/