[PATCH] of: deep-probe: replace BUG() with more verbose panic()

Sascha Hauer sha at pengutronix.de
Thu Mar 3 02:05:50 PST 2022


On Wed, Mar 02, 2022 at 09:08:01PM +0100, Ahmad Fatoum wrote:
> In the case, we do hit this bug, the node name can be helpful, so
> print it out.
> 
> Signed-off-by: Ahmad Fatoum <ahmad at a3f.at>
> ---
>  drivers/of/platform.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 0e718469dbcd..9b487cbb0c68 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -422,7 +422,9 @@ int of_device_ensure_probed(struct device_node *np)
>  	if (IS_ERR(dev))
>  		return PTR_ERR(dev);
>  
> -	BUG_ON(!dev);
> +	if (!dev)
> +		panic("deep-probe: device for '%s' couldn't be created\n",
> +			 np->full_name);
>  
>  	/*
>  	 * The deep-probe mechanism relies on the fact that all necessary
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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