diff options
author | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-13 01:55:58 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-13 01:55:58 +0200 |
commit | cbdf8824faaeab6f989bee60443987ef6272e77a (patch) | |
tree | 37548b5e8680fbf4b93c8ed9d39b2d4020c4ef2b /cpu/ppc4xx/4xx_enet.c | |
parent | b604a40b4f802e045c273344f3d9f553f9193f3e (diff) | |
parent | 4f92ac3648483cef34eadf69da1f0895a5a148d8 (diff) |
Merge with /home/sr/git/u-boot
Diffstat (limited to 'cpu/ppc4xx/4xx_enet.c')
-rw-r--r-- | cpu/ppc4xx/4xx_enet.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cpu/ppc4xx/4xx_enet.c b/cpu/ppc4xx/4xx_enet.c index 34f6e973f..d3f1de435 100644 --- a/cpu/ppc4xx/4xx_enet.c +++ b/cpu/ppc4xx/4xx_enet.c @@ -139,7 +139,7 @@ static uint32_t mal_ier; #if !defined(CONFIG_NET_MULTI) -struct eth_device *emac0_dev; +struct eth_device *emac0_dev = NULL; #endif @@ -306,8 +306,10 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis) /* before doing anything, figure out if we have a MAC address */ /* if not, bail */ - if (memcmp (dev->enetaddr, "\0\0\0\0\0\0", 6) == 0) + if (memcmp (dev->enetaddr, "\0\0\0\0\0\0", 6) == 0) { + printf("ERROR: ethaddr not set!\n"); return -1; + } #if defined(CONFIG_440GX) /* Need to get the OPB frequency so we can access the PHY */ @@ -1486,12 +1488,16 @@ void eth_halt (void) { int eth_init (bd_t *bis) { ppc_4xx_eth_initialize(bis); - return(ppc_4xx_eth_init(emac0_dev, bis)); + if (emac0_dev) { + return ppc_4xx_eth_init(emac0_dev, bis); + } else { + printf("ERROR: ethaddr not set!\n"); + return -1; + } } int eth_send(volatile void *packet, int length) { - return (ppc_4xx_eth_send(emac0_dev, packet, length)); } |