[PATCH 1/2] common: bbu: only add available handlers

Sascha Hauer sha at pengutronix.de
Sun Jun 20 21:38:54 PDT 2021


On Fri, Jun 18, 2021 at 02:05:57PM +0200, Rouven Czerwinski wrote:
> A board may have multiple handlers registered:
> 
>   registered update handlers:
>     SD          -> /dev/mmc0.barebox
>   * eMMC        -> /dev/mmc1
> 
> However when using the usbgadget with the -b command line argument,
> fastboot will stat all devicefiles listed in the handlers and will fail
> if i.e. the SD card is not available:
> 
>   usbgadget -A /dev/mmc1(root) -b
>   udc0: registering UDC driver [g_multi]
>   multi_bind: creating Fastboot function
>   ERROR: g_multi udc0: failed to start g_multi: -2
>   usbgadget: No such file or directory
> 
> To fix this, check the availability of handlers before adding them to
> the list and skip those that are not available with an info level message.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski at pengutronix.de>
> ---
>  common/bbu.c | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)

Applied with some whitespace changes, thanks

Sascha

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