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 65D31C433EF for ; Fri, 8 Apr 2022 14:31:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9E3883A3A; Fri, 8 Apr 2022 16:31:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="SgTIjzqK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3DCE383919; Fri, 8 Apr 2022 16:31:31 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 0539983D47 for ; Fri, 8 Apr 2022 16:31:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AB86161DE6; Fri, 8 Apr 2022 14:31:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1201C385A8; Fri, 8 Apr 2022 14:31:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649428285; bh=VwQ8o2hho/6PTVBYhhF3kLZkl7cErsabVKdkCfeMNew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SgTIjzqKseuQT0XLsxQYPZ9R8EYgHA3QnypRZUIuSn3EVR038YszVqFtjX4Ezf4f7 P1/w1tJAsqfoT3RuweeJl8unod0Wqkj7ExJCCCDahdsG/wTJtZtKpjrtwU24KK24Hc xshOj91XB+gWcxnhoj145JCOeg+/GwD6qOX59X5K8KBRqWgr7k5ufr5uFAg4w5GHbl 3d5VPGNMbU81dCO3mzbVC+QndoGNYF8xkSS0SuxSJ112DKqDuQm6CSVL6snJUrVAwm WKZgF3pve75FrT8kBnIFv/0u8+FP/qxdvetYC5dx4x26/8hkah//4rWJYj3vCRzcrz Ke5yWH70q+zyA== Received: by pali.im (Postfix) id 3DC20B0A; Fri, 8 Apr 2022 16:31:22 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , Marek Behun Cc: u-boot@lists.denx.de Subject: [PATCH 2/4] board: turris: Do not cache Atsha device in BSS Date: Fri, 8 Apr 2022 16:30:13 +0200 Message-Id: <20220408143015.23163-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220408143015.23163-1-pali@kernel.org> References: <20220408143015.23163-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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.5 at phobos.denx.de X-Virus-Status: Clean Atsha device is used prior relocation and at this early stage BSS does not have to be ready yet. So do not cache Atsha device in BSS. Fixes support for other Turris routers. Signed-off-by: Pali Rohár --- board/CZ.NIC/turris_atsha_otp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/board/CZ.NIC/turris_atsha_otp.c b/board/CZ.NIC/turris_atsha_otp.c index a4a77c74fb19..840721a9b737 100644 --- a/board/CZ.NIC/turris_atsha_otp.c +++ b/board/CZ.NIC/turris_atsha_otp.c @@ -18,10 +18,8 @@ static struct udevice *get_atsha204a_dev(void) { - static struct udevice *dev; - - if (dev) - return dev; + /* Cannot be static because BSS does not have to be ready at this early stage */ + struct udevice *dev; if (uclass_get_device_by_name(UCLASS_MISC, "atsha204a@64", &dev)) { puts("Cannot find ATSHA204A on I2C bus!\n"); -- 2.20.1