From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3401C54EE9 for ; Tue, 27 Sep 2022 21:39:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 560A784E10; Tue, 27 Sep 2022 23:38:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="MTg2fzAP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hEXuOcIQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B3B084DF6; Tue, 27 Sep 2022 23:38:25 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CE2EB84E16 for ; Tue, 27 Sep 2022 23:38:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9F0D921BCF; Tue, 27 Sep 2022 21:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664314698; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pnUBVr+AYs/4ij3GFcDIkbmEOVPTO4FudwY/nL3SeLo=; b=MTg2fzAPBGDI7o3VAxJ64LSxg/qQRQuK44wcpbciDjrdiozqTLhtfskveyAkp7BjWvr8Ms 0050jGoDCuvUFNDd9gKVrVqLP+jm1KhwZZh2K/UfhfESxP3jG49rj/AbtqeZ3ZdQyPeIFx QYeRsw3+dgQC533ThYXTsnuT1Ai3aic= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664314698; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pnUBVr+AYs/4ij3GFcDIkbmEOVPTO4FudwY/nL3SeLo=; b=hEXuOcIQI1YtMq53/mHhyALcAseK9ZkBIVJXxO/D9MCFEa0uFAEnSPfYsRG64wjb3Nt9Dk zlSS6cP9i5u87rAg== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id 845812C18B; Tue, 27 Sep 2022 21:38:18 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Simon Glass Subject: [PATCH v5 04/15] bootstd: Fix listing boot devices Date: Tue, 27 Sep 2022 23:37:56 +0200 Message-Id: <357a0d89a6557783b991fd7a4db60ce55d7ff930.1664314043.git.msuchanek@suse.de> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean bootdev_list() uses uclass_*_device_err() to iterate devices. However, the only value _err adds is returning an error when the device pointer is null, and that's checked anyway. Also there is some intent to report errors, and that's what uclass_*_device_check() is for, use it. Also print the symbolic error. Signed-off-by: Michal Suchanek --- boot/bootdev-uclass.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 13ac69eb39..e7115c5750 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -195,16 +196,16 @@ void bootdev_list(bool probe) printf("Seq Probed Status Uclass Name\n"); printf("--- ------ ------ -------- ------------------\n"); if (probe) - ret = uclass_first_device_err(UCLASS_BOOTDEV, &dev); + ret = uclass_first_device_check(UCLASS_BOOTDEV, &dev); else ret = uclass_find_first_device(UCLASS_BOOTDEV, &dev); for (i = 0; dev; i++) { printf("%3x [ %c ] %6s %-9.9s %s\n", dev_seq(dev), device_active(dev) ? '+' : ' ', - ret ? simple_itoa(ret) : "OK", + ret ? errno_str(ret) : "OK", dev_get_uclass_name(dev_get_parent(dev)), dev->name); if (probe) - ret = uclass_next_device_err(&dev); + ret = uclass_next_device_check(&dev); else ret = uclass_find_next_device(&dev); } -- 2.37.3