From: "Pali Rohár" <pali@kernel.org>
To: Priyanka Jain <priyanka.jain@nxp.com>, Wolfgang Denk <wd@denx.de>
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 [thread overview]
Message-ID: <20220402222427.19212-3-pali@kernel.org> (raw)
In-Reply-To: <20220402222427.19212-1-pali@kernel.org>
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 <pali@kernel.org>
---
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
next prev parent reply other threads:[~2022-04-02 22:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-02 22:24 [PATCH 0/3] powerpc: p2020: Allow to compile it without env support Pali Rohár
2022-04-02 22:24 ` [PATCH 1/3] hwconfig: " Pali Rohár
2022-04-02 22:24 ` Pali Rohár [this message]
2022-04-02 22:24 ` [PATCH 3/3] board: freescale: p1_p2_rdb_pc: " Pali Rohár
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220402222427.19212-3-pali@kernel.org \
--to=pali@kernel.org \
--cc=priyanka.jain@nxp.com \
--cc=u-boot@lists.denx.de \
--cc=wd@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.