[U-Boot,PATCHv2,3/5] fsl: layerscape: guard *env_sf_get_env_addr() on CONFIG_ENV_IS_IN_SPI_FLASH
diff mbox series

Message ID 20191119010210.24477-3-trini@konsulko.com
State Accepted
Delegated to: Tom Rini
Headers show
Series
  • [U-Boot,PATCHv2,1/5] smart-gateway-mt7688: Rework build time check for overwriting factory data
Related show

Commit Message

Tom Rini Nov. 19, 2019, 1:02 a.m. UTC
These functions can only be built and used when we have
ENV_IS_IN_SPI_FLASH, use that as a guard.

Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v2:
- Update commit message, add reviewed-by
---
 board/freescale/ls1043aqds/ls1043aqds.c | 2 +-
 board/freescale/ls1046aqds/ls1046aqds.c | 2 +-
 board/freescale/ls1088a/ls1088a.c       | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

Comments

Tom Rini Nov. 21, 2019, 5:17 p.m. UTC | #1
On Mon, Nov 18, 2019 at 08:02:08PM -0500, Tom Rini wrote:

> These functions can only be built and used when we have
> ENV_IS_IN_SPI_FLASH, use that as a guard.
> 
> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

Patch
diff mbox series

diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c
index 45f006dab720..8c96b962b788 100644
--- a/board/freescale/ls1043aqds/ls1043aqds.c
+++ b/board/freescale/ls1043aqds/ls1043aqds.c
@@ -525,7 +525,7 @@  u16 flash_read16(void *addr)
 	return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00);
 }
 
-#ifdef CONFIG_TFABOOT
+#if defined(CONFIG_TFABOOT) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
 void *env_sf_get_env_addr(void)
 {
 	return (void *)(CONFIG_SYS_FSL_QSPI_BASE + CONFIG_ENV_OFFSET);
diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c
index 6a51dcd64913..aac5d9aa848f 100644
--- a/board/freescale/ls1046aqds/ls1046aqds.c
+++ b/board/freescale/ls1046aqds/ls1046aqds.c
@@ -482,7 +482,7 @@  u16 flash_read16(void *addr)
 	return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00);
 }
 
-#ifdef CONFIG_TFABOOT
+#if defined(CONFIG_TFABOOT) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
 void *env_sf_get_env_addr(void)
 {
 	return (void *)(CONFIG_SYS_FSL_QSPI_BASE + CONFIG_ENV_OFFSET);
diff --git a/board/freescale/ls1088a/ls1088a.c b/board/freescale/ls1088a/ls1088a.c
index f1592982a348..4ecf6dce6855 100644
--- a/board/freescale/ls1088a/ls1088a.c
+++ b/board/freescale/ls1088a/ls1088a.c
@@ -1008,8 +1008,10 @@  int is_flash_available(void)
 }
 #endif
 
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
 void *env_sf_get_env_addr(void)
 {
 	return (void *)(CONFIG_SYS_FSL_QSPI_BASE + CONFIG_ENV_OFFSET);
 }
 #endif
+#endif