[PATCH v2 1/2] watchdog: imxwd: Convert error messages in .probe to dev_err_probe()

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Jun 29 02:26:34 PDT 2022


On 29.06.22 10:56, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at 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 at 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 |



More information about the barebox mailing list