[PATCH] [FS] Print error message for unknown device type

Nikita Ermakov coffe92 at gmail.com
Wed Jan 22 13:06:40 CET 2020


On Wed, 22 Jan 2020 at 14:09, Wolfgang Denk <wd at denx.de> wrote:

> File system commands like "ls" etc. require a device type parameter.
> If an unknown type is specified, they return an error code but no
> visible feedback to the user:
>
>  -> ls FOOBAR 1:1 /
>  ->
>
> Add an error message to make clear what happens, and why.
>
> Signed-off-by: Wolfgang Denk <wd at denx.de>
> ---
>  disk/part.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/disk/part.c b/disk/part.c
> index 8982ef3bae..14000835c8 100644
> --- a/disk/part.c
> +++ b/disk/part.c
> @@ -512,8 +512,10 @@ int blk_get_device_part_str(const char *ifname, const
> char *dev_part_str,
>
>         /* Look up the device */
>         dev = blk_get_device_by_str(ifname, dev_str, dev_desc);
> -       if (dev < 0)
> +       if (dev < 0) {
> +               printf("** Unknown device type %s **\n", ifname);
>                 goto cleanup;
> +       }
>
>         /* Convert partition ID string to number */
>         if (!part_str || !*part_str) {
> --
> 2.23.0
>
>
Oww, I've submitted the similar patch to this mailing list recently but it
is waiting for moderator approval :)

-- 
Thanks,
Nikita
B8 00 4C CD 21


More information about the U-Boot mailing list