From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753395AbcGVH2l (ORCPT ); Fri, 22 Jul 2016 03:28:41 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:39772 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752708AbcGVH2j (ORCPT ); Fri, 22 Jul 2016 03:28:39 -0400 Date: Fri, 22 Jul 2016 09:28:36 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Amitoj Kaur Chawla Cc: wsa@the-dreams.de, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, julia.lawall@lip6.fr Subject: Re: [PATCH v2] 2c: mv64xxx: Use clk_enable_prepare and clk_disable_unprepare Message-ID: <20160722072836.GO5368@pengutronix.de> References: <20160720051417.GA21765@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160720051417.GA21765@amitoj-Inspiron-3542> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org there is an i missing in the Subject. On Wed, Jul 20, 2016 at 10:44:18AM +0530, Amitoj Kaur Chawla wrote: > Replace clk_enable and clk_prepare with clk_enable_prepare and > clk_disable and clk_unprepare with clk_disable_unprepare. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression e; > @@ > > - clk_prepare(e); > - clk_enable(e); > + clk_prepare_enable(e); > > @@ > expression e; > @@ > > - clk_disable(e); > - clk_unprepare(e); > + clk_disable_unprepare(e); > > Signed-off-by: Amitoj Kaur Chawla > --- > Changes in v2: > -Rebased patch > > drivers/i2c/busses/i2c-mv64xxx.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c > index 43207f5..79bae48 100644 > --- a/drivers/i2c/busses/i2c-mv64xxx.c > +++ b/drivers/i2c/busses/i2c-mv64xxx.c > @@ -910,10 +910,8 @@ mv64xxx_i2c_probe(struct platform_device *pd) > #if defined(CONFIG_HAVE_CLK) > /* Not all platforms have a clk */ > drv_data->clk = devm_clk_get(&pd->dev, NULL); > - if (!IS_ERR(drv_data->clk)) { > - clk_prepare(drv_data->clk); > - clk_enable(drv_data->clk); > - } > + if (!IS_ERR(drv_data->clk)) > + clk_prepare_enable(drv_data->clk); When you touch this, better add error checking. I wonder why these functions are not marked __must_check. Also using IS_ERR(drv_data->clk) is wrong here, becauce devm_clk_get might return -EPROBE_DEFER. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |