mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 1/2] watchdog: imxwd: Convert error messages in .probe to dev_err_probe()
Date: Wed, 29 Jun 2022 10:56:27 +0200	[thread overview]
Message-ID: <20220629085628.106086-1-u.kleine-koenig@pengutronix.de> (raw)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/watchdog/imxwd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index 31ea388c2cf2..e9856c94c2fc 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -239,10 +239,9 @@ static int imx_wd_probe(struct device_d *dev)
 
 	priv = xzalloc(sizeof(struct imx_wd));
 	iores = dev_request_mem_resource(dev, 0);
-	if (IS_ERR(iores)) {
-		dev_err(dev, "could not get memory region\n");
-		return PTR_ERR(iores);
-	}
+	if (IS_ERR(iores))
+		return dev_err_probe(dev, PTR_ERR(iores),
+				     "could not get memory region\n");
 
 	clk = clk_get(dev, NULL);
 	if (IS_ERR(clk))
@@ -279,7 +278,8 @@ static int imx_wd_probe(struct device_d *dev)
 	if (priv->ops->init) {
 		ret = priv->ops->init(priv);
 		if (ret) {
-			dev_err(dev, "Failed to init watchdog device %d\n", ret);
+			dev_err_probe(dev, ret,
+				      "Failed to init watchdog device\n");
 			goto error_unregister;
 		}
 	}
-- 
2.36.1




             reply	other threads:[~2022-06-29  8:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  8:56 Uwe Kleine-König [this message]
2022-06-29  8:56 ` [PATCH v2 2/2] watchdog: imxwd: Add error messages for some failure points in .probe() Uwe Kleine-König
2022-06-29  9:27   ` Ahmad Fatoum
2022-06-29  9:26 ` [PATCH v2 1/2] watchdog: imxwd: Convert error messages in .probe to dev_err_probe() Ahmad Fatoum
2022-06-30  7:23 ` Sascha Hauer

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=20220629085628.106086-1-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.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