linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: linux-rtc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: [PATCH 14/16] rtc: rv3029: remove useless error messages
Date: Sat, 14 Dec 2019 23:10:20 +0100	[thread overview]
Message-ID: <20191214221022.622482-15-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20191214221022.622482-1-alexandre.belloni@bootlin.com>

Remove redundant messages or messages that would not add any value because
the information is already conveyed properly using errno.

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

diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
index 001d98aa33cc..b8d501abf2a7 100644
--- a/drivers/rtc/rtc-rv3029c2.c
+++ b/drivers/rtc/rtc-rv3029c2.c
@@ -320,10 +320,8 @@ static int rv3029_read_time(struct device *dev, struct rtc_time *tm)
 
 	ret = regmap_bulk_read(rv3029->regmap, RV3029_W_SEC, regs,
 			       RV3029_WATCH_SECTION_LEN);
-	if (ret < 0) {
-		dev_err(dev, "%s: reading RTC section failed\n", __func__);
+	if (ret < 0)
 		return ret;
-	}
 
 	tm->tm_sec = bcd2bin(regs[RV3029_W_SEC - RV3029_W_SEC]);
 	tm->tm_min = bcd2bin(regs[RV3029_W_MINUTES - RV3029_W_SEC]);
@@ -359,21 +357,16 @@ static int rv3029_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 
 	ret = regmap_bulk_read(rv3029->regmap, RV3029_A_SC, regs,
 			       RV3029_ALARM_SECTION_LEN);
-	if (ret < 0) {
-		dev_err(dev, "%s: reading alarm section failed\n", __func__);
+	if (ret < 0)
 		return ret;
-	}
 
 	ret = regmap_read(rv3029->regmap, RV3029_IRQ_CTRL, &controls);
-	if (ret) {
-		dev_err(dev, "Read IRQ Control Register error %d\n", ret);
+	if (ret)
 		return ret;
-	}
+
 	ret = regmap_read(rv3029->regmap, RV3029_IRQ_FLAGS, &flags);
-	if (ret < 0) {
-		dev_err(dev, "Read IRQ Flags Register error %d\n", ret);
+	if (ret < 0)
 		return ret;
-	}
 
 	tm->tm_sec = bcd2bin(regs[RV3029_A_SC - RV3029_A_SC] & 0x7f);
 	tm->tm_min = bcd2bin(regs[RV3029_A_MN - RV3029_A_SC] & 0x7f);
@@ -776,11 +769,8 @@ static int rv3029_i2c_probe(struct i2c_client *client,
 	}
 
 	regmap = devm_regmap_init_i2c(client, &config);
-	if (IS_ERR(regmap)) {
-		dev_err(&client->dev, "%s: regmap allocation failed: %ld\n",
-			__func__, PTR_ERR(regmap));
+	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
-	}
 
 	return rv3029_probe(&client->dev, regmap, client->irq, client->name);
 }
@@ -837,11 +827,8 @@ static int rv3049_probe(struct spi_device *spi)
 	struct regmap *regmap;
 
 	regmap = devm_regmap_init_spi(spi, &config);
-	if (IS_ERR(regmap)) {
-		dev_err(&spi->dev, "%s: regmap allocation failed: %ld\n",
-			__func__, PTR_ERR(regmap));
+	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
-	}
 
 	return rv3029_probe(&spi->dev, regmap, spi->irq, "rv3049");
 }
@@ -881,16 +868,10 @@ static int __init rv30x9_init(void)
 	int ret;
 
 	ret = rv3029_register_driver();
-	if (ret) {
-		pr_err("Failed to register rv3029 driver: %d\n", ret);
+	if (ret)
 		return ret;
-	}
 
-	ret = rv3049_register_driver();
-	if (ret) {
-		pr_err("Failed to register rv3049 driver: %d\n", ret);
-		rv3029_unregister_driver();
-	}
+	return rv3049_register_driver();
 
 	return ret;
 }
-- 
2.23.0


  parent reply	other threads:[~2019-12-14 22:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 22:10 [PATCH 00/16] rtc: rv3029: cleanup and features Alexandre Belloni
2019-12-14 22:10 ` [PATCH 01/16] rtc: rv3029: use proper name for the driver Alexandre Belloni
2019-12-14 22:10 ` [PATCH 02/16] rtc: rv3029: let regmap validate the register ranges Alexandre Belloni
2019-12-14 22:10 ` [PATCH 03/16] rtc: rv3029: remove open coded regmap_update_bits Alexandre Belloni
2019-12-14 22:10 ` [PATCH 04/16] rtc: rv3029: remove race condition when update STATUS Alexandre Belloni
2019-12-14 22:10 ` [PATCH 05/16] rtc: rv3029: avoid reading the status register uselessly Alexandre Belloni
2019-12-14 22:10 ` [PATCH 06/16] rtc: rv3029: get rid of rv3029_get_sr Alexandre Belloni
2019-12-14 22:10 ` [PATCH 07/16] rtc: rv3029: simplify rv3029_alarm_irq_enable Alexandre Belloni
2019-12-14 22:10 ` [PATCH 08/16] rtc: rv3029: simplify rv3029_set_alarm Alexandre Belloni
2019-12-14 22:10 ` [PATCH 09/16] rtc: rv3029: drop rv3029_read_regs and rv3029_write_regs Alexandre Belloni
2019-12-14 22:10 ` [PATCH 10/16] rtc: rv3029: add RTC_VL_READ and RTC_VL_CLEAR support Alexandre Belloni
2019-12-14 22:10 ` [PATCH 11/16] rtc: rv3029: correctly handle PON and VLOW2 Alexandre Belloni
2019-12-14 22:10 ` [PATCH 12/16] rtc: rv3029: convert to devm_rtc_allocate_device Alexandre Belloni
2019-12-14 22:10 ` [PATCH 13/16] rtc: rv3029: let the core handle rtc range Alexandre Belloni
2019-12-14 22:10 ` Alexandre Belloni [this message]
2019-12-14 22:10 ` [PATCH 15/16] rtc: rv3029: annotate init and exit functions Alexandre Belloni
2019-12-14 22:10 ` [PATCH 16/16] rtc: rv3029: add nvram support 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=20191214221022.622482-15-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;
as well as URLs for NNTP newsgroup(s).