]> git.sur5r.net Git - u-boot/blobdiff - net/eth.c
sh: ecovec: correct romImage address in comment
[u-boot] / net / eth.c
index 49458c8db914b96aa082920ed800639b73fcbb2a..32bd10c8290a6e2af662b566d8d64405a2c5efe1 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -2,23 +2,7 @@
  * (C) Copyright 2001-2010
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * 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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -218,9 +202,12 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
        }
 
        if (dev->write_hwaddr &&
-                       !eth_mac_skip(eth_number) &&
-                       is_valid_ether_addr(dev->enetaddr))
+                       !eth_mac_skip(eth_number)) {
+               if (!is_valid_ether_addr(dev->enetaddr))
+                       return -1;
+
                ret = dev->write_hwaddr(dev);
+       }
 
        return ret;
 }
@@ -292,7 +279,7 @@ int eth_initialize(bd_t *bis)
        eth_current = NULL;
 
        bootstage_mark(BOOTSTAGE_ID_NET_ETH_START);
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
        miiphy_init();
 #endif