xilinx: Change logic around zynq_board_read_rom_ethaddr()
authorMichal Simek <michal.simek@xilinx.com>
Mon, 3 Aug 2020 10:59:28 +0000 (12:59 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 20 Aug 2020 07:49:20 +0000 (09:49 +0200)
There is no reason to build private function when
CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET is not defined. There is already weak
function which handles default case properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/common/board.c

index 3bca3a2..0782d08 100644 (file)
 #include <linux/sizes.h>
 #include "board.h"
 
+#if defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 {
        int ret = -EINVAL;
-
-#if defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
        struct udevice *dev;
        ofnode eeprom;
 
@@ -37,10 +36,10 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
                debug("%s: I2C EEPROM MAC address read failed\n", __func__);
        else
                debug("%s: I2C EEPROM MAC %pM\n", __func__, ethaddr);
-#endif
 
        return ret;
 }
+#endif
 
 #if defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE)
 void *board_fdt_blob_setup(void)