From: Alim Akhtar <alim.akhtar@samsung.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Sangbeom Kim <sbkim73@samsung.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Lee Jones <lee.jones@linaro.org>,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
rtc-linux@googlegroups.com
Cc: Yadwinder Singh Brar <yadi.brar01@gmail.com>
Subject: [rtc-linux] Re: [PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields
Date: Wed, 30 Dec 2015 15:36:46 +0530 [thread overview]
Message-ID: <5683ACB6.8040004@samsung.com> (raw)
In-Reply-To: <1451450847-928-1-git-send-email-k.kozlowski@samsung.com>
Hi Krzysztof,
On 12/30/2015 10:17 AM, Krzysztof Kozlowski wrote:
> 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 <k.kozlowski@samsung.com>
>
Looks good.
Tested for s2mps15 pmic on exynos7-espresso board. Works well as before.
Fill free to add
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
>
> Changes since v1:
> 1. None.
> ---
> 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,
>
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
WARNING: multiple messages have this Message-ID (diff)
From: Alim Akhtar <alim.akhtar@samsung.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Sangbeom Kim <sbkim73@samsung.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Lee Jones <lee.jones@linaro.org>,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
rtc-linux@googlegroups.com
Cc: Yadwinder Singh Brar <yadi.brar01@gmail.com>
Subject: Re: [PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields
Date: Wed, 30 Dec 2015 15:36:46 +0530 [thread overview]
Message-ID: <5683ACB6.8040004@samsung.com> (raw)
In-Reply-To: <1451450847-928-1-git-send-email-k.kozlowski@samsung.com>
Hi Krzysztof,
On 12/30/2015 10:17 AM, Krzysztof Kozlowski wrote:
> 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 <k.kozlowski@samsung.com>
>
Looks good.
Tested for s2mps15 pmic on exynos7-espresso board. Works well as before.
Fill free to add
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
>
> Changes since v1:
> 1. None.
> ---
> 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,
>
next prev parent reply other threads:[~2015-12-30 10:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-30 4:47 [rtc-linux] [PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields Krzysztof Kozlowski
2015-12-30 4:47 ` Krzysztof Kozlowski
2015-12-30 4:47 ` [rtc-linux] [PATCH v2 2/3] rtc: s5m: Add separate field for storing auto-cleared mask in register config Krzysztof Kozlowski
2015-12-30 4:47 ` Krzysztof Kozlowski
2015-12-30 10:09 ` [rtc-linux] " Alim Akhtar
2015-12-30 10:09 ` Alim Akhtar
2015-12-30 4:47 ` [rtc-linux] [PATCH v2 3/3] rtc: s5m: Make register configuration per S2MPS device to remove exceptions Krzysztof Kozlowski
2015-12-30 4:47 ` Krzysztof Kozlowski
2015-12-30 10:14 ` [rtc-linux] " Alim Akhtar
2015-12-30 10:14 ` Alim Akhtar
2015-12-30 12:26 ` [rtc-linux] " Krzysztof Kozlowski
2015-12-30 12:26 ` Krzysztof Kozlowski
2016-01-11 9:42 ` Lee Jones
2016-01-11 9:42 ` Lee Jones
2015-12-30 10:06 ` Alim Akhtar [this message]
2015-12-30 10:06 ` [PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields Alim Akhtar
2016-01-04 17:08 ` [rtc-linux] " Alexandre Belloni
2016-01-04 17:08 ` Alexandre Belloni
2016-01-04 23:53 ` [rtc-linux] " Krzysztof Kozlowski
2016-01-04 23:53 ` Krzysztof Kozlowski
2016-01-05 0:04 ` [rtc-linux] " Krzysztof Kozlowski
2016-01-05 0:04 ` Krzysztof Kozlowski
2016-01-05 0:07 ` [rtc-linux] " Alexandre Belloni
2016-01-05 0:07 ` Alexandre Belloni
2016-01-11 19:25 ` [rtc-linux] " Alexandre Belloni
2016-01-11 19:25 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5683ACB6.8040004@samsung.com \
--to=alim.akhtar@samsung.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=k.kozlowski@samsung.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=sbkim73@samsung.com \
--cc=yadi.brar01@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.