[PATCH 4/4] arm: mvebu: clearfog: fix compile w/o EEPROM

Joel Johnson mrjoel at lixil.net
Sun Jan 19 08:10:50 CET 2020


Add conditional checks to ensure still builds without warnings when
the EEPROM runtime detection is disabled via config.

Signed-off-by: Joel Johnson <mrjoel at lixil.net>
---

 board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
index f407f744bf..031accaf64 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -87,6 +87,18 @@ static struct mv_ddr_topology_map board_topology_map = {
 	0x3,				/* clock enable mask */
 };
 
+static bool sr_product_is(const char *product)
+{
+	/* Allow prefix sub-string match */
+	if (strncmp(tlv_product_name[0], product, strlen(product)) == 0)
+		return true;
+	if (strncmp(tlv_product_name[1], product, strlen(product)) == 0)
+		return true;
+
+	return false;
+}
+
+#if defined (CONFIG_SPL_CMD_SYS_EEPROM)
 static void store_product_name(tlvinfo_tlv_t *tlv_entry)
 {
 	int len;
@@ -104,17 +116,6 @@ static void store_product_name(tlvinfo_tlv_t *tlv_entry)
 	memcpy(dest, tlv_entry->value, len);
 }
 
-static bool sr_product_is(const char *product)
-{
-	/* Allow prefix sub-string match */
-	if (strncmp(tlv_product_name[0], product, strlen(product)) == 0)
-		return true;
-	if (strncmp(tlv_product_name[1], product, strlen(product)) == 0)
-		return true;
-
-	return false;
-}
-
 static void parse_tlv_vendor_ext(tlvinfo_tlv_t *tlv_entry)
 {
 	struct if_params *ifp = &board_topology_map.interface_params[0];
@@ -172,9 +173,11 @@ static void parse_tlv_data(uint8_t *eeprom, tlvinfo_header_t *hdr,
 		tlv_offset += sizeof(tlvinfo_tlv_t) + entry->length;
 	}
 }
+#endif
 
 static void read_tlv_data(void)
 {
+#if defined (CONFIG_SPL_CMD_SYS_EEPROM)
 	uint8_t eeprom_data[TLV_TOTAL_LEN_MAX];
 	tlvinfo_header_t *tlv_hdr;
 	tlvinfo_tlv_t *tlv_entry;
@@ -204,6 +207,7 @@ static void read_tlv_data(void)
 		board_serdes_map[4].serdes_speed = SERDES_SPEED_5_GBPS;
 		board_serdes_map[4].serdes_mode = SERDES_DEFAULT_MODE;
 	}
+#endif
 }
 
 struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)
-- 
2.20.1



More information about the U-Boot mailing list