[U-Boot] [PATCH 1/4] sunxi: Fix build when CONFIG_CMD_NET is disabled

megous at megous.com megous at megous.com
Sat Feb 9 13:39:54 UTC 2019


From: Ondrej Jirman <megous at megous.com>

Signed-off-by: Ondřej Jirman <megous at megous.com>
---
 board/sunxi/board.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 98bc3cd0c1..e918bdf36b 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -774,9 +774,12 @@ static void setup_environment(const void *fdt)
 {
 	char serial_string[17] = { 0 };
 	unsigned int sid[4];
+#if defined CONFIG_CMD_NET
 	uint8_t mac_addr[6];
 	char ethaddr[16];
-	int i, ret;
+	int i;
+#endif
+	int ret;
 
 	ret = sunxi_get_sid(sid);
 	if (ret == 0 && sid[0] != 0) {
@@ -801,6 +804,7 @@ static void setup_environment(const void *fdt)
 		if ((sid[3] & 0xffffff) == 0)
 			sid[3] |= 0x800000;
 
+#if defined CONFIG_CMD_NET
 		for (i = 0; i < 4; i++) {
 			sprintf(ethaddr, "ethernet%d", i);
 			if (!fdt_get_alias(fdt, ethaddr))
@@ -824,6 +828,7 @@ static void setup_environment(const void *fdt)
 
 			eth_env_set_enetaddr(ethaddr, mac_addr);
 		}
+#endif
 
 		if (!env_get("serial#")) {
 			snprintf(serial_string, sizeof(serial_string),
-- 
2.20.1



More information about the U-Boot mailing list