* [PATCH] rtc: amlogic-a4: drop error messages
@ 2024-11-12 14:36 alexandre.belloni
2024-11-12 15:04 ` neil.armstrong
0 siblings, 1 reply; 2+ messages in thread
From: alexandre.belloni @ 2024-11-12 14:36 UTC (permalink / raw)
To: Yiting Deng, Xianwei Zhao, Alexandre Belloni
Cc: linux-amlogic, linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Drop error message because there is a high probability they will never be
seen and the final user action is clear, the time has to be set again.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-amlogic-a4.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/rtc/rtc-amlogic-a4.c b/drivers/rtc/rtc-amlogic-a4.c
index 9423dce4193d..4960790c4b24 100644
--- a/drivers/rtc/rtc-amlogic-a4.c
+++ b/drivers/rtc/rtc-amlogic-a4.c
@@ -102,10 +102,8 @@ static int aml_rtc_read_time(struct device *dev, struct rtc_time *tm)
u32 time_sec;
/* if RTC disabled, read time failed */
- if (!rtc->rtc_enabled) {
- dev_err(dev, "RTC disabled, read time failed\n");
+ if (!rtc->rtc_enabled)
return -EINVAL;
- }
regmap_read(rtc->map, RTC_REAL_TIME, &time_sec);
if (rtc->config->gray_stored)
@@ -145,10 +143,8 @@ static int aml_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
time64_t alarm_sec;
/* if RTC disabled, set alarm failed */
- if (!rtc->rtc_enabled) {
- dev_err(dev, "RTC disabled, set alarm failed\n");
+ if (!rtc->rtc_enabled)
return -EINVAL;
- }
regmap_update_bits(rtc->map, RTC_CTRL,
RTC_ALRM0_EN, RTC_ALRM0_EN);
@@ -174,10 +170,8 @@ static int aml_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
int alarm_mask;
/* if RTC disabled, read alarm failed */
- if (!rtc->rtc_enabled) {
- dev_err(dev, "RTC disabled, read alarm failed\n");
+ if (!rtc->rtc_enabled)
return -EINVAL;
- }
regmap_read(rtc->map, RTC_ALARM0_REG, &alarm_sec);
if (rtc->config->gray_stored)
@@ -201,10 +195,8 @@ static int aml_rtc_read_offset(struct device *dev, long *offset)
int sign, match_counter, enable;
/* if RTC disabled, read offset failed */
- if (!rtc->rtc_enabled) {
- dev_err(dev, "RTC disabled, read offset failed\n");
+ if (!rtc->rtc_enabled)
return -EINVAL;
- }
regmap_read(rtc->map, RTC_SEC_ADJUST_REG, ®_val);
enable = FIELD_GET(RTC_ADJ_VALID, reg_val);
@@ -231,10 +223,8 @@ static int aml_rtc_set_offset(struct device *dev, long offset)
u32 reg_val;
/* if RTC disabled, set offset failed */
- if (!rtc->rtc_enabled) {
- dev_err(dev, "RTC disabled, set offset failed\n");
+ if (!rtc->rtc_enabled)
return -EINVAL;
- }
if (offset) {
enable = 1;
--
2.47.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtc: amlogic-a4: drop error messages
2024-11-12 14:36 [PATCH] rtc: amlogic-a4: drop error messages alexandre.belloni
@ 2024-11-12 15:04 ` neil.armstrong
0 siblings, 0 replies; 2+ messages in thread
From: neil.armstrong @ 2024-11-12 15:04 UTC (permalink / raw)
To: alexandre.belloni, Yiting Deng, Xianwei Zhao
Cc: linux-amlogic, linux-rtc, linux-kernel
On 12/11/2024 15:36, alexandre.belloni@bootlin.com wrote:
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> Drop error message because there is a high probability they will never be
> seen and the final user action is clear, the time has to be set again.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> drivers/rtc/rtc-amlogic-a4.c | 20 +++++---------------
> 1 file changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/rtc/rtc-amlogic-a4.c b/drivers/rtc/rtc-amlogic-a4.c
> index 9423dce4193d..4960790c4b24 100644
> --- a/drivers/rtc/rtc-amlogic-a4.c
> +++ b/drivers/rtc/rtc-amlogic-a4.c
> @@ -102,10 +102,8 @@ static int aml_rtc_read_time(struct device *dev, struct rtc_time *tm)
> u32 time_sec;
>
> /* if RTC disabled, read time failed */
> - if (!rtc->rtc_enabled) {
> - dev_err(dev, "RTC disabled, read time failed\n");
> + if (!rtc->rtc_enabled)
> return -EINVAL;
> - }
>
> regmap_read(rtc->map, RTC_REAL_TIME, &time_sec);
> if (rtc->config->gray_stored)
> @@ -145,10 +143,8 @@ static int aml_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
> time64_t alarm_sec;
>
> /* if RTC disabled, set alarm failed */
> - if (!rtc->rtc_enabled) {
> - dev_err(dev, "RTC disabled, set alarm failed\n");
> + if (!rtc->rtc_enabled)
> return -EINVAL;
> - }
>
> regmap_update_bits(rtc->map, RTC_CTRL,
> RTC_ALRM0_EN, RTC_ALRM0_EN);
> @@ -174,10 +170,8 @@ static int aml_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
> int alarm_mask;
>
> /* if RTC disabled, read alarm failed */
> - if (!rtc->rtc_enabled) {
> - dev_err(dev, "RTC disabled, read alarm failed\n");
> + if (!rtc->rtc_enabled)
> return -EINVAL;
> - }
>
> regmap_read(rtc->map, RTC_ALARM0_REG, &alarm_sec);
> if (rtc->config->gray_stored)
> @@ -201,10 +195,8 @@ static int aml_rtc_read_offset(struct device *dev, long *offset)
> int sign, match_counter, enable;
>
> /* if RTC disabled, read offset failed */
> - if (!rtc->rtc_enabled) {
> - dev_err(dev, "RTC disabled, read offset failed\n");
> + if (!rtc->rtc_enabled)
> return -EINVAL;
> - }
>
> regmap_read(rtc->map, RTC_SEC_ADJUST_REG, ®_val);
> enable = FIELD_GET(RTC_ADJ_VALID, reg_val);
> @@ -231,10 +223,8 @@ static int aml_rtc_set_offset(struct device *dev, long offset)
> u32 reg_val;
>
> /* if RTC disabled, set offset failed */
> - if (!rtc->rtc_enabled) {
> - dev_err(dev, "RTC disabled, set offset failed\n");
> + if (!rtc->rtc_enabled)
> return -EINVAL;
> - }
>
> if (offset) {
> enable = 1;
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-12 15:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 14:36 [PATCH] rtc: amlogic-a4: drop error messages alexandre.belloni
2024-11-12 15:04 ` neil.armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox