]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/fec_mxc.c
net: e1000: typo using wrong argument to sizeof
[u-boot] / drivers / net / fec_mxc.c
index 6b801ce24aa97102313ea5a1adaf791a89e2bb5b..c17f9379bf93a3ff663395f0f3b56c8aa5fa60c9 100644 (file)
@@ -62,7 +62,7 @@ struct fec_priv gfec = {
 /*
  * MII-interface related functions
  */
-static int fec_miiphy_read(char *dev, uint8_t phyAddr, uint8_t regAddr,
+static int fec_miiphy_read(const char *dev, uint8_t phyAddr, uint8_t regAddr,
                uint16_t *retVal)
 {
        struct eth_device *edev = eth_get_dev_by_name(dev);
@@ -119,7 +119,7 @@ static void fec_mii_setspeed(struct fec_priv *fec)
        debug("fec_init: mii_speed %#lx\n",
                        fec->eth->mii_speed);
 }
-static int fec_miiphy_write(char *dev, uint8_t phyAddr, uint8_t regAddr,
+static int fec_miiphy_write(const char *dev, uint8_t phyAddr, uint8_t regAddr,
                uint16_t data)
 {
        struct eth_device *edev = eth_get_dev_by_name(dev);
@@ -414,6 +414,9 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
        uint32_t base;
        struct fec_priv *fec = (struct fec_priv *)dev->priv;
 
+       /* Initialize MAC address */
+       fec_set_hwaddr(dev);
+
        /*
         * reserve memory for both buffer descriptor chains at once
         * Datasheet forces the startaddress of each chain is 16 byte
@@ -707,6 +710,7 @@ static int fec_probe(bd_t *bd)
                puts("fec_mxc: not enough malloc memory\n");
                return -ENOMEM;
        }
+       memset(edev, 0, sizeof(*edev));
        edev->priv = fec;
        edev->init = fec_init;
        edev->send = fec_send;