From patchwork Wed Dec 30 01:53:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 7931101 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1D8439F350 for ; Wed, 30 Dec 2015 01:53:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F029E20160 for ; Wed, 30 Dec 2015 01:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 791A02010C for ; Wed, 30 Dec 2015 01:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754017AbbL3BxX (ORCPT ); Tue, 29 Dec 2015 20:53:23 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:31553 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753903AbbL3BxW (ORCPT ); Tue, 29 Dec 2015 20:53:22 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O050011JEKVEPA0@mailout2.w1.samsung.com>; Wed, 30 Dec 2015 01:53:19 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-de-5683390ef1ce Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 3A.EA.21385.E0933865; Wed, 30 Dec 2015 01:53:18 +0000 (GMT) Received: from localhost.localdomain ([10.113.63.52]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O0500GRVEKLUA20@eusync1.samsung.com>; Wed, 30 Dec 2015 01:53:18 +0000 (GMT) From: Krzysztof Kozlowski To: Sangbeom Kim , Krzysztof Kozlowski , Alessandro Zummo , Alexandre Belloni , Lee Jones , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, rtc-linux@googlegroups.com Cc: Alim Akhtar Subject: [PATCH 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields Date: Wed, 30 Dec 2015 10:53:03 +0900 Message-id: <1451440385-8654-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupiluLIzCtJLcpLzFFi42I5/e/4ZV0+y+Ywg62LzCyWXLzKbtFxbTGT xYN529gsXr8wtLj/9SijxeVdc9gsZpzfx2Sxv7OD0eLiii9MDpweTzZdZPTYM/Ekm8eda3vY PPq2rGL0mD7vJ5PH501yAWxRXDYpqTmZZalF+nYJXBk9uy+wFbRrVkw+u4uxgXG2YhcjJ4eE gIlE27NlrBC2mMSFe+vZuhi5OIQEljJK3F23hR3C+c8osWPZM2aQKjYBY4nNy5eAVYkIHGSS ePdgOliCWUBTor39C9goYYFQiSPP7rCB2CwCqhLHm38xdTFycPAKuEkcOVIDsU1O4uSxyawT GLkXMDKsYhRNLU0uKE5KzzXSK07MLS7NS9dLzs/dxAgJoa87GJceszrEKMDBqMTDe0KoOUyI NbGsuDL3EKMEB7OSCG+mFlCINyWxsiq1KD++qDQntfgQozQHi5I478xd70OEBNITS1KzU1ML UotgskwcnFINjI2LU59f6k84dkuk79ze2Go5nvCvb+WnmcyeYzHnUdjMJywrda/NermjsuFq UNfjp48tGCOaDXfLtmpHLDZUVDef/+60X8x13y/8Uze98rm5+/2B+KeN0/Ve8E2dw3JctPzZ M3XvA98vely4L2L/1Gmf24QnzyfH/GZy6iyNWhuyyub1g41S3LJKLMUZiYZazEXFiQDSw8Tx HQIAAA== 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=-6.9 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 Remove the 'rtc' prefix from some of the fields in struct s5m_rtc_reg_config because it is obvious - this is a RTC driver. No functional changes. Signed-off-by: Krzysztof Kozlowski --- drivers/rtc/rtc-s5m.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c index 0d68a85dd429..85649861a6b0 100644 --- a/drivers/rtc/rtc-s5m.c +++ b/drivers/rtc/rtc-s5m.c @@ -55,9 +55,9 @@ struct s5m_rtc_reg_config { * will enable update of time or alarm register. Then it will be * auto-cleared after successful update. */ - unsigned int rtc_udr_update; - /* Mask for UDR field in 'rtc_udr_update' register */ - unsigned int rtc_udr_mask; + unsigned int udr_update; + /* Mask for UDR field in 'udr_update' register */ + unsigned int udr_mask; }; /* Register map for S5M8763 and S5M8767 */ @@ -67,8 +67,8 @@ static const struct s5m_rtc_reg_config s5m_rtc_regs = { .ctrl = S5M_ALARM1_CONF, .alarm0 = S5M_ALARM0_SEC, .alarm1 = S5M_ALARM1_SEC, - .rtc_udr_update = S5M_RTC_UDR_CON, - .rtc_udr_mask = S5M_RTC_UDR_MASK, + .udr_update = S5M_RTC_UDR_CON, + .udr_mask = S5M_RTC_UDR_MASK, }; /* @@ -81,8 +81,8 @@ static const struct s5m_rtc_reg_config s2mps_rtc_regs = { .ctrl = S2MPS_RTC_CTRL, .alarm0 = S2MPS_ALARM0_SEC, .alarm1 = S2MPS_ALARM1_SEC, - .rtc_udr_update = S2MPS_RTC_UDR_CON, - .rtc_udr_mask = S2MPS_RTC_WUDR_MASK, + .udr_update = S2MPS_RTC_UDR_CON, + .udr_mask = S2MPS_RTC_WUDR_MASK, }; struct s5m_rtc_info { @@ -166,9 +166,8 @@ static inline int s5m8767_wait_for_udr_update(struct s5m_rtc_info *info) unsigned int data; do { - ret = regmap_read(info->regmap, info->regs->rtc_udr_update, - &data); - } while (--retry && (data & info->regs->rtc_udr_mask) && !ret); + ret = regmap_read(info->regmap, info->regs->udr_update, &data); + } while (--retry && (data & info->regs->udr_mask) && !ret); if (!retry) dev_err(info->dev, "waiting for UDR update, reached max number of retries\n"); @@ -214,7 +213,7 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info) int ret; unsigned int data; - ret = regmap_read(info->regmap, info->regs->rtc_udr_update, &data); + ret = regmap_read(info->regmap, info->regs->udr_update, &data); if (ret < 0) { dev_err(info->dev, "failed to read update reg(%d)\n", ret); return ret; @@ -223,21 +222,20 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info) switch (info->device_type) { case S5M8763X: case S5M8767X: - data |= info->regs->rtc_udr_mask | S5M_RTC_TIME_EN_MASK; + data |= info->regs->udr_mask | S5M_RTC_TIME_EN_MASK; case S2MPS15X: /* As per UM, for write time register, set WUDR bit to high */ data |= S2MPS15_RTC_WUDR_MASK; break; case S2MPS14X: case S2MPS13X: - data |= info->regs->rtc_udr_mask; + data |= info->regs->udr_mask; break; default: return -EINVAL; } - - ret = regmap_write(info->regmap, info->regs->rtc_udr_update, data); + ret = regmap_write(info->regmap, info->regs->udr_update, data); if (ret < 0) { dev_err(info->dev, "failed to write update reg(%d)\n", ret); return ret; @@ -253,14 +251,14 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info) int ret; unsigned int data; - ret = regmap_read(info->regmap, info->regs->rtc_udr_update, &data); + ret = regmap_read(info->regmap, info->regs->udr_update, &data); if (ret < 0) { dev_err(info->dev, "%s: fail to read update reg(%d)\n", __func__, ret); return ret; } - data |= info->regs->rtc_udr_mask; + data |= info->regs->udr_mask; switch (info->device_type) { case S5M8763X: case S5M8767X: @@ -268,7 +266,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info) break; case S2MPS15X: /* As per UM, for write alarm, set A_UDR(bit[4]) to high - * rtc_udr_mask above sets bit[4] + * udr_mask above sets bit[4] */ break; case S2MPS14X: @@ -281,7 +279,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info) return -EINVAL; } - ret = regmap_write(info->regmap, info->regs->rtc_udr_update, data); + ret = regmap_write(info->regmap, info->regs->udr_update, data); if (ret < 0) { dev_err(info->dev, "%s: fail to write update reg(%d)\n", __func__, ret); @@ -292,7 +290,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info) /* On S2MPS13 the AUDR is not auto-cleared */ if (info->device_type == S2MPS13X) - regmap_update_bits(info->regmap, info->regs->rtc_udr_update, + regmap_update_bits(info->regmap, info->regs->udr_update, S2MPS13_RTC_AUDR_MASK, 0); return ret; @@ -339,7 +337,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm) if (info->device_type == S2MPS15X || info->device_type == S2MPS14X || info->device_type == S2MPS13X) { ret = regmap_update_bits(info->regmap, - info->regs->rtc_udr_update, + info->regs->udr_update, S2MPS_RTC_RUDR_MASK, S2MPS_RTC_RUDR_MASK); if (ret) { dev_err(dev,