davinci: da850evm: Make EEPROM MAC code configurable
authorAdam Ford <aford173@gmail.com>
Fri, 8 Sep 2017 22:01:17 +0000 (17:01 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 13 Sep 2017 13:24:26 +0000 (09:24 -0400)
There was a check for CONFIG_MAC_ADDR_IN_EEPROM and
a check for CONFIG_MAC_ADDR_IN_SPIFLASH, however
some of the EEPROM related code wasn't encapsulated
inside the #if defined statement so the EEPROM code
could get executed even when it wasn't explicitly
enabled or wanted.

Signed-off-by: Adam Ford <aford173@gmail.com>
board/davinci/da8xxevm/da850evm.c

index c2d2e8e882919eff7b1b02eab765eee12b9d878a..516d86df5097208c7b0d93595934f44c17adf8f4 100644 (file)
@@ -133,6 +133,8 @@ int misc_init_r(void)
 
        enetaddr_found = eth_env_get_enetaddr("ethaddr", env_enetaddr);
 
+#endif
+
 #ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
        int spi_mac_read;
        uchar buff[6];
@@ -167,7 +169,8 @@ int misc_init_r(void)
                                        "with the MAC address in the environment\n");
                printf("Default using MAC address from environment\n");
        }
-#endif
+
+#elif defined(CONFIG_MAC_ADDR_IN_EEPROM)
        uint8_t enetaddr[8];
        int eeprom_mac_read;