mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: alexandre.belloni@bootlin.com
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rtc: m41t80: reduce verbosity
Date: Mon, 26 May 2025 00:21:52 +0200	[thread overview]
Message-ID: <20250525222153.1472917-1-alexandre.belloni@bootlin.com> (raw)

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

The driver currently uses dev_err for messages that have a very low probability
of being read by the user as the error will probably never happen and the
systems with the RTC probably don't have any user able to read the message.

Moreover, the only user action after getting this message is the restart the
action so drop the level to dev_dbg.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-m41t80.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 7074d086f1c8..c568639d2151 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -212,7 +212,7 @@ static int m41t80_rtc_read_time(struct device *dev, struct rtc_time *tm)
 	err = i2c_smbus_read_i2c_block_data(client, M41T80_REG_SSEC,
 					    sizeof(buf), buf);
 	if (err < 0) {
-		dev_err(&client->dev, "Unable to read date\n");
+		dev_dbg(&client->dev, "Unable to read date\n");
 		return err;
 	}
 
@@ -268,7 +268,7 @@ static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *in_tm)
 	err = i2c_smbus_write_i2c_block_data(client, M41T80_REG_SSEC,
 					     sizeof(buf), buf);
 	if (err < 0) {
-		dev_err(&client->dev, "Unable to write to date registers\n");
+		dev_dbg(&client->dev, "Unable to write to date registers\n");
 		return err;
 	}
 	if (flags & M41T80_FLAGS_OF) {
@@ -276,12 +276,12 @@ static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *in_tm)
 		dev_warn(&client->dev, "OF bit is still set, kickstarting clock.\n");
 		err = i2c_smbus_write_byte_data(client, M41T80_REG_SEC, M41T80_SEC_ST);
 		if (err < 0) {
-			dev_err(&client->dev, "Can't set ST bit\n");
+			dev_dbg(&client->dev, "Can't set ST bit\n");
 			return err;
 		}
 		err = i2c_smbus_write_byte_data(client, M41T80_REG_SEC, flags & ~M41T80_SEC_ST);
 		if (err < 0) {
-			dev_err(&client->dev, "Can't clear ST bit\n");
+			dev_dbg(&client->dev, "Can't clear ST bit\n");
 			return err;
 		}
 		/* oscillator must run for 4sec before we attempt to reset OF bit */
@@ -289,14 +289,14 @@ static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *in_tm)
 		/* Clear the OF bit of Flags Register */
 		err = i2c_smbus_write_byte_data(client, M41T80_REG_FLAGS, flags & ~M41T80_FLAGS_OF);
 		if (err < 0) {
-			dev_err(&client->dev, "Unable to write flags register\n");
+			dev_dbg(&client->dev, "Unable to write flags register\n");
 			return err;
 		}
 		flags = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS);
 		if (flags < 0) {
 			return flags;
 		} else if (flags & M41T80_FLAGS_OF) {
-			dev_err(&client->dev, "Can't clear the OF bit check battery\n");
+			dev_dbg(&client->dev, "Can't clear the OF bit check battery\n");
 			return err;
 		}
 	}
@@ -336,7 +336,7 @@ static int m41t80_alarm_irq_enable(struct device *dev, unsigned int enabled)
 
 	retval = i2c_smbus_write_byte_data(client, M41T80_REG_ALARM_MON, flags);
 	if (retval < 0) {
-		dev_err(dev, "Unable to enable alarm IRQ %d\n", retval);
+		dev_dbg(dev, "Unable to enable alarm IRQ %d\n", retval);
 		return retval;
 	}
 	return 0;
@@ -361,7 +361,7 @@ static int m41t80_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 	err = i2c_smbus_write_byte_data(client, M41T80_REG_ALARM_MON,
 					ret & ~(M41T80_ALMON_AFE));
 	if (err < 0) {
-		dev_err(dev, "Unable to clear AFE bit\n");
+		dev_dbg(dev, "Unable to clear AFE bit\n");
 		return err;
 	}
 
@@ -375,7 +375,7 @@ static int m41t80_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 	err = i2c_smbus_write_byte_data(client, M41T80_REG_FLAGS,
 					ret & ~(M41T80_FLAGS_AF));
 	if (err < 0) {
-		dev_err(dev, "Unable to clear AF bit\n");
+		dev_dbg(dev, "Unable to clear AF bit\n");
 		return err;
 	}
 
-- 
2.49.0


                 reply	other threads:[~2025-05-25 22:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250525222153.1472917-1-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®