From patchwork Wed Jan 22 11:08:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 239920 List-Id: U-Boot discussion From: wd at denx.de (Wolfgang Denk) Date: Wed, 22 Jan 2020 12:08:52 +0100 Subject: [PATCH] [FS] Print error message for unknown device type Message-ID: <20200122110852.2741617-1-wd@denx.de> 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 Tested-by: Heiko Schocher Reviewed-by: Simon Glass --- 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) {