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 B5932C433EF for ; Sat, 2 Apr 2022 22:25:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EEBA483931; Sun, 3 Apr 2022 00:24:57 +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="X5p+Kfjz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 698E6839BB; Sun, 3 Apr 2022 00:24:54 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (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 64BF2839D3 for ; Sun, 3 Apr 2022 00:24:48 +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 ams.source.kernel.org (Postfix) with ESMTPS id 1BCF7B80187; Sat, 2 Apr 2022 22:24:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8032C340F3; Sat, 2 Apr 2022 22:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648938286; bh=6T/3PKG33VJP4DU4d4rvHBqbN6O2yfhXqLjXsZl/oh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X5p+KfjzDKTItmpynpOTRzzeKpBq3EDBF9bEnBglvNVErFR/jEaJ0fDO9AGPIAl5q rbb8hPDGd3mX3JHTopEDydeugf/E6x5WaT0UPtO1/+MA0M9i/njmH088Qldbm7PjBV nDvIrcWIcI2ACdDvPS5shmI/pJd/JNG6u0iX5wHuHr7we5zyoptPII/+QJSiuJtgGw /D3tfNyEKF1C+iNembj/ycZOWBGN5nn+YITzEelKijzgdtG7Q5I0FzOxLzkjjNvqp1 jlvyn4PNjrv0WYkXLQWoJzmjyq4F49SIyITXehS9Xg0N2+RuomSFGZYhAhRFtzEjV8 BwbQoNvizPtcw== Received: by pali.im (Postfix) id 75A2D1640; Sun, 3 Apr 2022 00:24:44 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Priyanka Jain , Wolfgang Denk Cc: u-boot@lists.denx.de Subject: [PATCH 2/3] ddr: fsl: Allow to compile it without env support Date: Sun, 3 Apr 2022 00:24:26 +0200 Message-Id: <20220402222427.19212-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220402222427.19212-1-pali@kernel.org> References: <20220402222427.19212-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 When env support is disabled then usage of env_get_f() generates linker errors. So do not compile env_get_f() when env support is disabled (for example when disabled only in SPL). Signed-off-by: Pali Rohár --- drivers/ddr/fsl/options.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/ddr/fsl/options.c b/drivers/ddr/fsl/options.c index c000a45f8ea8..9555b9a29d45 100644 --- a/drivers/ddr/fsl/options.c +++ b/drivers/ddr/fsl/options.c @@ -761,7 +761,9 @@ unsigned int populate_memctl_options(const common_timing_params_t *common_dimm, * Extract hwconfig from environment since we have not properly setup * the environment but need it for ddr config params */ +#if CONFIG_IS_ENABLED(ENV_SUPPORT) if (env_get_f("hwconfig", buf, sizeof(buf)) < 0) +#endif buf[0] = '\0'; #if defined(CONFIG_SYS_FSL_DDR3) || \ @@ -1408,7 +1410,9 @@ int fsl_use_spd(void) * Extract hwconfig from environment since we have not properly setup * the environment but need it for ddr config params */ +#if CONFIG_IS_ENABLED(ENV_SUPPORT) if (env_get_f("hwconfig", buf, sizeof(buf)) < 0) +#endif buf[0] = '\0'; /* if hwconfig is not enabled, or "sdram" is not defined, use spd */ -- 2.20.1