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: 1227175 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=T12SCQaB; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 482jMs35RGz9sRd for ; Wed, 22 Jan 2020 22:09:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BE229801F1; Wed, 22 Jan 2020 12:09:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1579691348; bh=t3YvLPdmPBEKU7HwjLKb7Lxc5+sX1LrlnJw+YFEu6A8=; h=From:To:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=T12SCQaBXaYScXY0e5NpfRg4vd+qRt6mUAXnl3ZBx2oko9TNQa5FfuevrL193z61T XqULoEQntlk12dDfe4vafDQXbotKrzFM4b2zg3kb4J9o3Vi5UDlcdqwn58TQpRtOUS UQ9wRD2HGCHiagKzsobdmcL/bNhjeDXW8Viye2lWK7vVxZU7QdqzwWJWpVSExyQQ8U V1dP2Ln9yiVuxOINJ2sUYYwB6ORIoQHgvG9332EyobzL9HKiacdgOIu9n6NUbdyAI1 MYPZt8zSoIB37nvswtz7+kUPX/7cEkM0U/IgcN7C7rNbO4JRp4e1OWwS+VctJFTEaI GV+vPmUiuV/cw== Received: by phobos.denx.de (Postfix, from userid 109) id 8B72B80417; Wed, 22 Jan 2020 12:09:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8CB2F80199 for ; Wed, 22 Jan 2020 12:09:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=wd@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 482jMf5ZFfz1rYHL for ; Wed, 22 Jan 2020 12:09:02 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 482jMf5Swyz1qr2W for ; Wed, 22 Jan 2020 12:09:02 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 31R9brgj3Rx6 for ; Wed, 22 Jan 2020 12:09:01 +0100 (CET) X-Auth-Info: 5ZCQujmyhuFFsJJWQmkwMeMdvUemOiQvi0v7aiclqwg= Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA for ; Wed, 22 Jan 2020 12:09:01 +0100 (CET) Received: by janitor.denx.de (Postfix, from userid 119) id 69934A2BA0; Wed, 22 Jan 2020 12:09:01 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 1FE60A2B80 for ; Wed, 22 Jan 2020 12:09:00 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id 7FFC72420C7; Wed, 22 Jan 2020 12:08:59 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Subject: [PATCH] [FS] Print error message for unknown device type Date: Wed, 22 Jan 2020 12:08:52 +0100 Message-Id: <20200122110852.2741617-1-wd@denx.de> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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) {