From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
barebox@lists.infradead.org
Subject: Re: [PATCH v2 2/2] watchdog: imxwd: Add error messages for some failure points in .probe()
Date: Wed, 29 Jun 2022 11:27:25 +0200 [thread overview]
Message-ID: <56cfb8bd-f0dc-abaf-61ac-ddf32410160b@pengutronix.de> (raw)
In-Reply-To: <20220629085628.106086-2-u.kleine-koenig@pengutronix.de>
On 29.06.22 10:56, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> Hello,
>
> as suggested by afa I'm using dev_err_probe() here now.
>
> Best regards
> Uwe
>
> drivers/watchdog/imxwd.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
> index e9856c94c2fc..dba92cb46afb 100644
> --- a/drivers/watchdog/imxwd.c
> +++ b/drivers/watchdog/imxwd.c
> @@ -245,11 +245,11 @@ static int imx_wd_probe(struct device_d *dev)
>
> clk = clk_get(dev, NULL);
> if (IS_ERR(clk))
> - return PTR_ERR(clk);
> + return dev_err_probe(dev, PTR_ERR(clk), "Failed to get clk\n");
>
> ret = clk_enable(clk);
> if (ret)
> - return ret;
> + return dev_err_probe(dev, ret, "Failed to enable clk\n");
>
> priv->base = IOMEM(iores->start);
> priv->ops = ops;
> @@ -271,8 +271,10 @@ static int imx_wd_probe(struct device_d *dev)
> }
>
> ret = watchdog_register(&priv->wd);
> - if (ret)
> + if (ret) {
> + dev_err_probe(dev, ret, "Failed to register watchdog device\n");
> goto on_error;
> + }
> }
>
> if (priv->ops->init) {
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2022-06-29 9:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 8:56 [PATCH v2 1/2] watchdog: imxwd: Convert error messages in .probe to dev_err_probe() Uwe Kleine-König
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 [this message]
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=56cfb8bd-f0dc-abaf-61ac-ddf32410160b@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=u.kleine-koenig@pengutronix.de \
/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