]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/arm926ejs/davinci/misc.c
Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / arch / arm / cpu / arm926ejs / davinci / misc.c
index 5f510b61dbdd2425a370098ea80a05537f23e718..e18bdfc729b7ad3ae0b57a01f3b1f76edfd033cb 100644 (file)
@@ -6,22 +6,7 @@
  * Copyright (C) 2008 Lyrtech <www.lyrtech.com>
  * Copyright (C) 2004 Texas Instruments.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -101,9 +86,10 @@ void davinci_emac_mii_mode_sel(int mode_sel)
 void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
 {
        uint8_t env_enetaddr[6];
+       int ret;
 
-       eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
-       if (!memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
+       ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
+       if (!ret) {
                /*
                 * There is no MAC address in the environment, so we
                 * initialize it from the value in the EEPROM.
@@ -111,8 +97,10 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
                debug("### Setting environment from EEPROM MAC address = "
                        "\"%pM\"\n",
                        env_enetaddr);
-               eth_setenv_enetaddr("ethaddr", rom_enetaddr);
+               ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr);
        }
+       if (!ret)
+               printf("Failed to set mac address from EEPROM: %d\n", ret);
 }
 #endif /* CONFIG_DRIVER_TI_EMAC */