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 27C13C433FE for ; Wed, 12 Oct 2022 20:01:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6F2A084F40; Wed, 12 Oct 2022 21:59:31 +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="JjAjoXr6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Cruso8FE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B545084E9B; Wed, 12 Oct 2022 21:58:56 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (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 A7D6584F1E for ; Wed, 12 Oct 2022 21:58:31 +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 78BB5223EB; Wed, 12 Oct 2022 19:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1665604711; 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=Ok0pPOiblpVzU5nbiY/vHvhaQZc9zcxkg5UJIlAICKM=; b=JjAjoXr6ZY1E0hH5iHeabCC2COHKeN319RU0XDXg3ZFjYHR/Bp9BjjspSg+62lG+3cfxB0 C6rPQzWXS7DgYSQXxsX4is3XPwQuTVqnpW6lTjweaAXx4HJAsDk6a5Pi7aP2PT0p2h1L5y iJD0JwgjQTId7jynxc8Wpe093u7y+0w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1665604711; 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=Ok0pPOiblpVzU5nbiY/vHvhaQZc9zcxkg5UJIlAICKM=; b=Cruso8FEH+a4/vkeKtcHwqKIwTdFpAUjSW27NP0kZ9ErfXZ01F7ic4TYNSz0RxqeEqkZBd EDu5+Y2zkRe4smDQ== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id 5EE432C15F; Wed, 12 Oct 2022 19:58:31 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Mario Six Subject: [PATCH v6 15/20] mpc83xx: gazerbeam: Update sysinfo_get error handling Date: Wed, 12 Oct 2022 21:58:04 +0200 Message-Id: <3e115ee1df480108cc5843074a0678562cccd194.1665604425.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 In a later patch sysinfo_get will be changed to return the device in cae of an error. Set sysinfo to NULL on error to preserve previous behavior. Signed-off-by: Michal Suchanek --- board/gdsys/mpc8308/gazerbeam.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/board/gdsys/mpc8308/gazerbeam.c b/board/gdsys/mpc8308/gazerbeam.c index 3d4a7e57fe..ba88401f13 100644 --- a/board/gdsys/mpc8308/gazerbeam.c +++ b/board/gdsys/mpc8308/gazerbeam.c @@ -49,8 +49,10 @@ int board_early_init_r(void) int mc = 0; int con = 0; - if (sysinfo_get(&sysinfo)) + if (sysinfo_get(&sysinfo)) { puts("Could not find sysinfo information device.\n"); + sysinfo = NULL; + } /* Initialize serdes */ uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, "serdes", &serdes); @@ -92,8 +94,10 @@ int checksysinfo(void) int mc = 0; int con = 0; - if (sysinfo_get(&sysinfo)) + if (sysinfo_get(&sysinfo)) { puts("Could not find sysinfo information device.\n"); + sysinfo = NULL; + } sysinfo_get_int(sysinfo, BOARD_MULTICHANNEL, &mc); sysinfo_get_int(sysinfo, BOARD_VARIANT, &con); @@ -130,8 +134,10 @@ int last_stage_init(void) struct udevice *tpm; int ret; - if (sysinfo_get(&sysinfo)) + if (sysinfo_get(&sysinfo)) { puts("Could not find sysinfo information device.\n"); + sysinfo = NULL; + } if (sysinfo) { int res = sysinfo_get_int(sysinfo, BOARD_HWVERSION, -- 2.37.3