* [PATCH v2 1/2] watchdog: imxwd: Convert error messages in .probe to dev_err_probe()
@ 2022-06-29 8:56 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
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2022-06-29 8:56 UTC (permalink / raw)
To: barebox
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] watchdog: imxwd: Add error messages for some failure points in .probe()
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 ` 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
2 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2022-06-29 8:56 UTC (permalink / raw)
To: barebox
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@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) {
--
2.36.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] watchdog: imxwd: Convert error messages in .probe to dev_err_probe()
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:26 ` Ahmad Fatoum
2022-06-30 7:23 ` Sascha Hauer
2 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2022-06-29 9:26 UTC (permalink / raw)
To: Uwe Kleine-König, barebox
On 29.06.22 10:56, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Once there are enough dev_err_probe users, we could make it optional
to compile these strings in, so thanks for using it:
Reviewed-by: Ahmad Fatoum <a.fatoum@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;
> }
> }
--
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 |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] watchdog: imxwd: Add error messages for some failure points in .probe()
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
0 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2022-06-29 9:27 UTC (permalink / raw)
To: Uwe Kleine-König, barebox
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 |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] watchdog: imxwd: Convert error messages in .probe to dev_err_probe()
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: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
2 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2022-06-30 7:23 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: barebox
On Wed, Jun 29, 2022 at 10:56:27AM +0200, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/watchdog/imxwd.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Applied, thanks
Sascha
>
> 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
>
>
>
--
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 |
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-30 7:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox