From patchwork Tue Aug 11 11:28:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 6991651 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EAEDFC05AC for ; Tue, 11 Aug 2015 11:29:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0983620647 for ; Tue, 11 Aug 2015 11:29:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2106B2062F for ; Tue, 11 Aug 2015 11:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964892AbbHKL20 (ORCPT ); Tue, 11 Aug 2015 07:28:26 -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 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NSX006VV17AIN80@mailout2.samsung.com>; Tue, 11 Aug 2015 20:28:22 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.115]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 78.EF.29324.65CD9C55; Tue, 11 Aug 2015 20:28:22 +0900 (KST) X-AuditID: cbfee68d-f79106d00000728c-82-55c9dc561df7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 42.BB.07062.65CD9C55; Tue, 11 Aug 2015 20:28:22 +0900 (KST) Received: from localhost.localdomain ([10.252.81.123]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NSX00CU9179S570@mmp1.samsung.com>; Tue, 11 Aug 2015 20:28:21 +0900 (KST) 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 YJnAKLyAkWEVo2hqQXJBcVJ6kaFecWJucWleul5yfu4mRmDAn/73rHcH4+0D1ocYBTgYlXh4 BTxPhgqxJpYVV+YeYjQF2jCRWUo0OR8YV3kl8YbGZkYWpiamxkbmlmZK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v62elp9ey3M+fO2rrucf//Lfpufz8ELtqwcf+gzGGn5RYijMSDbWYi4oTAfKg +S7AAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }