]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - net/eth-uclass.c
ARC: dwmmc: Adding DesignWare MMC driver support for ARC devboards
[thirdparty/u-boot.git] / net / eth-uclass.c
index 240b5965345543ff679ae925a2401f9c254b6e8b..2ef20df19203767a89896c6089193706c135a32a 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2001-2015
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  * Joe Hershberger, National Instruments
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -308,12 +307,13 @@ void eth_halt(void)
        struct eth_device_priv *priv;
 
        current = eth_get_dev();
-       if (!current || !device_active(current))
+       if (!current || !eth_is_active(current))
                return;
 
        eth_get_ops(current)->stop(current);
        priv = current->uclass_priv;
-       priv->state = ETH_STATE_PASSIVE;
+       if (priv)
+               priv->state = ETH_STATE_PASSIVE;
 }
 
 int eth_is_active(struct udevice *dev)
@@ -396,7 +396,7 @@ int eth_initialize(void)
         * This is accomplished by attempting to probe each device and calling
         * their write_hwaddr() operation.
         */
-       uclass_first_device(UCLASS_ETH, &dev);
+       uclass_first_device_check(UCLASS_ETH, &dev);
        if (!dev) {
                printf("No ethernet found.\n");
                bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
@@ -425,7 +425,7 @@ int eth_initialize(void)
 
                        eth_write_hwaddr(dev);
 
-                       uclass_next_device(&dev);
+                       uclass_next_device_check(&dev);
                        num_devices++;
                } while (dev);
 
@@ -476,10 +476,8 @@ static int eth_post_probe(struct udevice *dev)
                        ops->free_pkt += gd->reloc_off;
                if (ops->stop)
                        ops->stop += gd->reloc_off;
-#ifdef CONFIG_MCAST_TFTP
                if (ops->mcast)
                        ops->mcast += gd->reloc_off;
-#endif
                if (ops->write_hwaddr)
                        ops->write_hwaddr += gd->reloc_off;
                if (ops->read_rom_hwaddr)