* Patch by Stefan Roese, 06 Apr 2005:
[platform/kernel/u-boot.git] / cpu / ppc4xx / 405gp_enet.c
index da45558..9d8e2b6 100644 (file)
@@ -414,6 +414,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 
        out32 (EMAC_IAL + hw_p->hw_addr, reg);
        switch (devnum) {
+#if defined(CONFIG_NET_MULTI)
        case 1:
                /* setup MAL tx & rx channel pointers */
                /* For 405EP, the EMAC1 tx channel 0 is MAL tx channel 2 */
@@ -422,6 +423,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
                /* set RX buffer size */
                mtdcr (malrcbs1, ENET_MAX_MTU_ALIGNED / 16);
                break;
+#endif
        case 0:
        default:
                /* setup MAL tx & rx channel pointers */
@@ -942,6 +944,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
                                "Cannot allocate eth_device %d\n", eth_num);
                        return (-1);
                }
+               memset(dev, 0, sizeof(*dev));
                /* Allocate our private use data */
                hw = (EMAC_405_HW_PST) malloc (sizeof (*hw));
                if (hw == NULL) {
@@ -951,6 +954,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
                        free (dev);
                        return (-1);
                }
+               memset(hw, 0, sizeof(*hw));
 
                switch (eth_num) {
                case 0: