phylib: phy_startup() should return an error code on failure
[oweals/u-boot.git] / drivers / net / ftgmac100.c
index dc7a80e5c77386d29c3b6bca1225de3c5590f79e..69ba57d3d006e7638b96106221966b7980389682 100644 (file)
@@ -33,8 +33,6 @@
 
 #define ETH_ZLEN       60
 
-#define mdelay(n) ({unsigned long msec = (n); while (msec--) udelay(1000); })
-
 /* RBSR - hw default init value is also 0x640 */
 #define RBSR_DEFAULT_VALUE     0x640
 
@@ -384,8 +382,6 @@ static int ftgmac100_init(struct eth_device *dev, bd_t *bd)
 
        debug("%s()\n", __func__);
 
-       ftgmac100_reset(dev);
-
        /* set the ethernet address */
        ftgmac100_set_mac_from_env(dev);
 
@@ -484,8 +480,7 @@ static int ftgmac100_recv(struct eth_device *dev)
 /*
  * Send a data block via Ethernet
  */
-static int
-ftgmac100_send(struct eth_device *dev, void *packet, int length)
+static int ftgmac100_send(struct eth_device *dev, void *packet, int length)
 {
        struct ftgmac100 *ftgmac100 = (struct ftgmac100 *)dev->iobase;
        struct ftgmac100_data *priv = dev->priv;
@@ -561,6 +556,8 @@ int ftgmac100_initialize(bd_t *bd)
 
        eth_register(dev);
 
+       ftgmac100_reset(dev);
+
        return 1;
 
 free_dev: