From patchwork Tue Aug 12 02:01:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: y@samsung.com X-Patchwork-Id: 4710501 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 010849F319 for ; Tue, 12 Aug 2014 02:03:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0665D2011D for ; Tue, 12 Aug 2014 02:03:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE8C020115 for ; Tue, 12 Aug 2014 02:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754577AbaHLCCA (ORCPT ); Mon, 11 Aug 2014 22:02:00 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:18686 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754023AbaHLCBV (ORCPT ); Mon, 11 Aug 2014 22:01:21 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NA600HW38A53O90@mailout4.samsung.com>; Tue, 12 Aug 2014 11:01:17 +0900 (KST) X-AuditID: cbfee61b-f79f86d00000144c-a5-53e9756d51ed Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 1E.5C.05196.D6579E35; Tue, 12 Aug 2014 11:01:17 +0900 (KST) Received: from chan.10.32.193.11 ([10.252.81.195]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NA60088D8A3OQI0@mmp1.samsung.com>; Tue, 12 Aug 2014 11:01:16 +0900 (KST) From: y@samsung.com To: a.zummo@towertech.it Cc: kgene.kim@samsung.com, kyungmin.park@samsung.com, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Chanwoo Choi Subject: [PATCHv2 2/5] rtc: s3c: Remove warning message when checking coding style with checkpatch script Date: Tue, 12 Aug 2014 11:01:08 +0900 Message-id: <1407808871-6046-3-git-send-email-y@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1407808871-6046-1-git-send-email-y@samsung.com> References: <1407808871-6046-1-git-send-email-y@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjluLIzCtJLcpLzFFi42I5/e+xgG5u6ctgg8NLhC2WXLzKbnH9y3NW i94FV9kszja9Ybe4vGsOm8WM8/uYLPZ3djA6sHvsmXiSzaNvyypGj+nzfjJ5fN4kF8ASxWWT kpqTWZZapG+XwJWx53g7Y8EGtYorjy4wNzAekO9i5OCQEDCReHDGq4uRE8gUk7hwbz1bFyMX h5DAIkaJI+/6GCGcJiaJhyd3MII0sAkIS0w9oAXSICIgIbFkzh2wGmaB3YwSk9e8ZAFJCAtk S9y7e5MRxGYRUJXY2jGBDcTmFbCRmPFlLjPENjmJD3sesYPYnAK2Er+WrADrFRLwkbg3+Qbr BEbeBYwMqxhFUwuSC4qT0nON9IoTc4tL89L1kvNzNzGCQ+mZ9A7GVQ0WhxgFOBiVeHhn/H0R LMSaWFZcmXuIUYKDWUmE95jsy2Ah3pTEyqrUovz4otKc1OJDjNIcLErivAdbrQOFBNITS1Kz U1MLUotgskwcnFINjAEBzjO5zVodXm6PvpJ+JPZ1nqn1sUXe/w/qb5jxaPamInOTn1NsuBTT 0id9jX4t4lqdkXlgS7qFWLPNo5nZB5YdZ7nxs+r4plT2ZeUTzPLmzbjzjW1jZsG063XNlraG Qov6YlueOv1IZty4fmKnfUHw/0m/I+1N+crN37v7He6J9t1kt6P5tRJLcUaioRZzUXEiAJSI PMQhAgAA 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.6 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 From: Chanwoo Choi This patch remove warning message when checking codeing style with checkpatch script and reduce un-necessary i2c read operation on s3c_rtc_enable. WARNING: line over 80 characters #406: FILE: drivers/rtc/rtc-s3c.c:406: + if ((readw(info->base + S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0) { WARNING: line over 80 characters #414: FILE: drivers/rtc/rtc-s3c.c:414: + if ((readw(info->base + S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)) { WARNING: line over 80 characters #422: FILE: drivers/rtc/rtc-s3c.c:422: + if ((readw(info->base + S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)) { WARNING: Missing a blank line after declarations #451: FILE: drivers/rtc/rtc-s3c.c:451: + struct s3c_rtc_drv_data *data; + if (pdev->dev.of_node) { WARNING: Missing a blank line after declarations #453: FILE: drivers/rtc/rtc-s3c.c:453: + const struct of_device_id *match; + match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node); WARNING: DT compatible string "samsung,s3c2416-rtc" appears un-documented -- check ./Documentation/devicetree/bindings/ #650: FILE: drivers/rtc/rtc-s3c.c:650: + .compatible = "samsung,s3c2416-rtc", WARNING: DT compatible string "samsung,s3c2443-rtc" appears un-documented -- check ./Documentation/devicetree/bindings/ #653: FILE: drivers/rtc/rtc-s3c.c:653: + .compatible = "samsung,s3c2443-rtc", Signed-off-by: Chanwoo Choi Acked-by: Kyungmin Park --- Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 2 ++ drivers/rtc/rtc-s3c.c | 26 ++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt index 7ac7259..06db446 100644 --- a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt @@ -3,6 +3,8 @@ Required properties: - compatible: should be one of the following. * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc. + * "samsung,s3c2416-rtc" - for controllers compatible with s3c2416 rtc. + * "samsung,s3c2443-rtc" - for controllers compatible with s3c2443 rtc. * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 rtc. - reg: physical base address of the controller and length of memory mapped region. diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 1d9e158..d8f25bd 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -400,28 +400,28 @@ static const struct rtc_class_ops s3c_rtcops = { static void s3c_rtc_enable(struct s3c_rtc *info, int en) { - unsigned int tmp; + unsigned int con, tmp; if (!info->base) return; clk_enable(info->rtc_clk); + + con = readw(info->base + S3C2410_RTCCON); if (!en) { - tmp = readw(info->base + S3C2410_RTCCON); if (info->cpu_type == TYPE_S3C64XX) - tmp &= ~S3C64XX_RTCCON_TICEN; - tmp &= ~S3C2410_RTCCON_RTCEN; - writew(tmp, info->base + S3C2410_RTCCON); + con &= ~S3C64XX_RTCCON_TICEN; + con &= ~S3C2410_RTCCON_RTCEN; + writew(con, info->base + S3C2410_RTCCON); if (info->cpu_type != TYPE_S3C64XX) { - tmp = readb(info->base + S3C2410_TICNT); - tmp &= ~S3C2410_TICNT_ENABLE; - writeb(tmp, info->base + S3C2410_TICNT); + con = readb(info->base + S3C2410_TICNT); + con &= ~S3C2410_TICNT_ENABLE; + writeb(con, info->base + S3C2410_TICNT); } } else { /* re-enable the device, and check it is ok */ - - if ((readw(info->base + S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0) { + if ((con & S3C2410_RTCCON_RTCEN) == 0) { dev_info(info->dev, "rtc disabled, re-enabling\n"); tmp = readw(info->base + S3C2410_RTCCON); @@ -429,7 +429,7 @@ static void s3c_rtc_enable(struct s3c_rtc *info, int en) info->base + S3C2410_RTCCON); } - if ((readw(info->base + S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)) { + if (con & S3C2410_RTCCON_CNTSEL) { dev_info(info->dev, "removing RTCCON_CNTSEL\n"); tmp = readw(info->base + S3C2410_RTCCON); @@ -437,7 +437,7 @@ static void s3c_rtc_enable(struct s3c_rtc *info, int en) info->base + S3C2410_RTCCON); } - if ((readw(info->base + S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)) { + if (con & S3C2410_RTCCON_CLKRST) { dev_info(info->dev, "removing RTCCON_CLKRST\n"); tmp = readw(info->base + S3C2410_RTCCON); @@ -466,8 +466,10 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) { #ifdef CONFIG_OF struct s3c_rtc_drv_data *data; + if (pdev->dev.of_node) { const struct of_device_id *match; + match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node); data = (struct s3c_rtc_drv_data *) match->data; return data->cpu_type;