[U-Boot] [PATCH 1/3] sunxi: musb: Improve output during probing

Ian Campbell ijc+uboot at hellion.org.uk
Sun Jun 21 10:00:06 CEST 2015


On Sat, 2015-06-20 at 17:35 +0200, Hans de Goede wrote:
> When we return an error the usb core will log a message, so in this case
> do not print a newline, instead print ": " after our identifier as a
> seperator between our identifier and the error message logged by the core.

"separator".

This seems like a lot of fragile faff second guessing what some other
component does (and is going to do in the future). Can we not have musb
take over init time logging completely or just live with:
        MUSB OTG: Failed host init
        Flux capacitor has reversed polarity
which I suppose is roughly how it appears today?

> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  drivers/usb/musb-new/sunxi.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
> index d1cb8e0..bb88687 100644
> --- a/drivers/usb/musb-new/sunxi.c
> +++ b/drivers/usb/musb-new/sunxi.c
> @@ -301,21 +301,26 @@ int musb_usb_probe(struct udevice *dev)
>  {
>  	struct musb_host_data *host = dev_get_priv(dev);
>  	struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
> +	int ret;
>  
>  	priv->desc_before_addr = true;
>  
> +	printf("MUSB OTG");
> +
>  	if (!host->host) {
>  		host->host = musb_init_controller(&musb_plat, NULL,
>  						  (void *)SUNXI_USB0_BASE);
>  		if (!host->host) {
> -			printf("Failed to init the controller\n");
> +			printf(": ");
>  			return -EIO;
>  		}
>  	}
>  
> -	printf("MUSB OTG in host-mode\n");
> +	ret = musb_lowlevel_init(host);
> +
> +	printf((ret == 0) ? "\n" : ": ");
>  
> -	return musb_lowlevel_init(host);
> +	return ret;
>  }
>  
>  int musb_usb_remove(struct udevice *dev)




More information about the U-Boot mailing list