Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964927AbbHKL21 (ORCPT ); Tue, 11 Aug 2015 07:28:27 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:50127 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934259AbbHKL2Y (ORCPT ); Tue, 11 Aug 2015 07:28:24 -0400 X-AuditID: cbfee68d-f79106d00000728c-82-55c9dc561df7 From: Joonyoung Shim To: 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, k.kozlowski@samsung.com, jy0922.shim@samsung.com Subject: [PATCH 3/4] rtc: s3c: use unified functions for enable/disable of clk Date: Tue, 11 Aug 2015 20:28:21 +0900 Message-id: <1439292502-22912-3-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1439292502-22912-1-git-send-email-jy0922.shim@samsung.com> References: <1439292502-22912-1-git-send-email-jy0922.shim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsWyRsSkWDfszslQg6ObhS2WXLzKbtFxbTGT xfUvz1ktXty7yGLx+oWhxeVdc9gsZpzfx2Sxv7OD0YHD48mmi4weeyaeZPPo27KK0WP6vJ9M Hp83yQWwRnHZpKTmZJalFunbJXBlNEz+ylzwhLdi44m1rA2MJ7i7GDk5JARMJNr7TzNB2GIS F+6tZ+ti5OIQEljBKLFt815WmKIdLy+yQySWMkosu7oayvnBKLHi9y6wdjYBPYk7246D2SIC chI3D74Ds5kFzjBKNJxMArGFBfwkfq78yAZiswioSlzc+BtsA6+Au8SGiTMZIbbJSZw8Nhks zingIXFr0mUWEFsIqObfsu2MIIslBBaxS3RNu8MCMUhA4tvkQ0A2B1BCVmLTAWaIOZISB1fc YJnAKLyAkWEVo2hqQXJBcVJ6kaFecWJucWleul5yfu4m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6jL21C 3xvP3rtHWiBuq5JLi5fUy90J65wl/n8wn/pwX++P/jbDcyJXG2fKsN98veOGu2Xd0eslYno7 j2wOSmdoWliv62elp9ey3M+fO2rrucf//Lfpufz8ELtqwcf+gzGGn5RYijMSDbWYi4oTAfKg +S7AAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1953 Lines: 61 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(-) 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; } -- 1.9.1 -- 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/