Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933229AbbHLAKN (ORCPT ); Tue, 11 Aug 2015 20:10:13 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:16294 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932485AbbHLAKL (ORCPT ); Tue, 11 Aug 2015 20:10:11 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-35-55ca8edf5c36 Message-id: <55CA8EDE.8000006@samsung.com> Date: Wed, 12 Aug 2015 09:10:06 +0900 From: Krzysztof Kozlowski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-version: 1.0 To: Joonyoung Shim , rtc-linux@googlegroups.com Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, a.zummo@towertech.it, alexandre.belloni@free-electrons.com, cw00.choi@samsung.com Subject: Re: [PATCH 3/4] rtc: s3c: use unified functions for enable/disable of clk References: <1439292502-22912-1-git-send-email-jy0922.shim@samsung.com> <1439292502-22912-3-git-send-email-jy0922.shim@samsung.com> In-reply-to: <1439292502-22912-3-git-send-email-jy0922.shim@samsung.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsVy+t/xy7r3+06FGtzcaWax5OJVdouOa4uZ LK5/ec5q8eLeRRaL1y8MLS7vmsNmMeP8PiaL/Z0djA4cHk82XWT02DPxJJtH35ZVjB7T5/1k 8vi8SS6ANYrLJiU1J7MstUjfLoEr4/P0d+wF3wQqLjcvZW9gfMHbxcjJISFgIrFk61xmCFtM 4sK99WxdjFwcQgJLGSUurdrOBOF8YZR4uWg5I0gVr4CWxLN5TWA2i4CqxLl7q1lBbDYBY4nN y5ewgdiiAhESy1efhKoXlPgx+R4LiC0i4CHxc9MbsA3MArMYJaY+e8oEkhAWCJH4t+0o1OpW RolDK74C3cTBwQnUMX0HH4jJLKAncf+iFkg5s4C8xOY1b5knMAINQVgxC6FqFpKqBYzMqxhF U0uTC4qT0nMN9YoTc4tL89L1kvNzNzFCgv3LDsbFx6wOMQpwMCrx8GZ6nwwVYk0sK67MPcQo wcGsJMJ7w+pUqBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeubvehwgJpCeWpGanphakFsFkmTg4 pRoYk62PZvTdOba71WTxIWmVaq5FzPXhTn3WiYKMU1a7fzI+/MD4z5rgMPPLZ7ztlOrmGic9 M752r8s+2cx9bsBMAyXZHoY1zZPSJBX+nglcq33r+NXk91MSrFM4dicYcIa+XJYTx7P06tvG 3HPuB5/kn1A/OP3Jwh+zYphd5pXnhNa5+ofs07ylxFKckWioxVxUnAgAminANHICAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2345 Lines: 71 On 11.08.2015 20:28, Joonyoung Shim wrote: > The driver uses clk_prepare_enable()/clk_disable_unprepare() only in > probe only, elsewhere, use the unified functions for enable/disable of > clk, e.g. s3c_rtc_enable_clk() / s3c_rtc_disable_clk(), so it's better > to use them for consistency of code. > > Signed-off-by: Joonyoung Shim > --- > drivers/rtc/rtc-s3c.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) First of all - the code is larger (9 insertions, 5 deletion) so I have doubts if this is better. Second - this is not equivalent change. The s3c_rtc_enable_clk/disable calls grab spin lock which is not necessary in probe. Best regards, Krzysztof > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c > index 44b2921..abe2a6d 100644 > --- a/drivers/rtc/rtc-s3c.c > +++ b/drivers/rtc/rtc-s3c.c > @@ -476,19 +476,21 @@ static int s3c_rtc_probe(struct platform_device *pdev) > dev_err(&pdev->dev, "failed to find rtc clock\n"); > return PTR_ERR(info->rtc_clk); > } > - clk_prepare_enable(info->rtc_clk); > + clk_prepare(info->rtc_clk); > > if (info->data->needs_src_clk) { > info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src"); > if (IS_ERR(info->rtc_src_clk)) { > dev_err(&pdev->dev, > "failed to find rtc source clock\n"); > - clk_disable_unprepare(info->rtc_clk); > + clk_unprepare(info->rtc_clk); > return PTR_ERR(info->rtc_src_clk); > } > - clk_prepare_enable(info->rtc_src_clk); > + clk_prepare(info->rtc_src_clk); > } > > + s3c_rtc_enable_clk(info); > + > /* check to see if everything is setup correctly */ > if (info->data->enable) > info->data->enable(info); > @@ -548,9 +550,11 @@ static int s3c_rtc_probe(struct platform_device *pdev) > if (info->data->disable) > info->data->disable(info); > > + s3c_rtc_disable_clk(info); > + > if (info->data->needs_src_clk) > - clk_disable_unprepare(info->rtc_src_clk); > - clk_disable_unprepare(info->rtc_clk); > + clk_unprepare(info->rtc_src_clk); > + clk_unprepare(info->rtc_clk); > > return ret; > } > -- 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/