Skip to contentSkip to conversation

rtc: amlogic-a4: drop error messages

PATCH In review [email protected] 2 participants 2 messages Nov 12, 2024

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 rtc: amlogic-a4: drop error messages

From: Alexandre Belloni <[email protected]>

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.

---
 drivers/rtc/rtc-amlogic-a4.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/rtc/rtc-amlogic-a4.c +5 -15
index 9423dce4193d..4960790c4b24 100644
@@ -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, &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;
Signature · 1 line
2.47.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 64 lines · On 12/11/2024 15:36, [email protected] wrote:

From: Alexandre Belloni <[email protected]>

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.

---
  drivers/rtc/rtc-amlogic-a4.c | 20 +++++---------------
  1 file changed, 5 insertions(+), 15 deletions(-)
drivers/rtc/rtc-amlogic-a4.c +4 -12
index 9423dce4193d..4960790c4b24 100644
@@ -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, &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;

drivers/rtc/rtc-amlogic-a4.c static int aml_rtc_set_offset(struct device *dev, long offset) · line 230

Quoted 10 lines
drivers/rtc/rtc-amlogic-a4.c +1 -3
 
  	/* 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;