diff options
author | Hui.Tang <zetalabs@gmail.com> | 2009-11-05 09:58:44 +0800 |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2009-11-09 10:39:36 -0800 |
commit | 497ab0eec5e1e2dfccc141a4485cd6b940e1424a (patch) | |
tree | e7d23ac9961945f7d72b06abab9fa95c9e0478e5 /drivers/net | |
parent | 0775437293a6963cb21244dfae6978cbf67c6bfe (diff) | |
download | u-boot-imx-497ab0eec5e1e2dfccc141a4485cd6b940e1424a.zip u-boot-imx-497ab0eec5e1e2dfccc141a4485cd6b940e1424a.tar.gz u-boot-imx-497ab0eec5e1e2dfccc141a4485cd6b940e1424a.tar.bz2 |
Fix cs8900 dev->priv not init issue
Ensure all CS8900 data structures are assigned before accessing device
Signed-off-by: Hui.Tang <zetalabs@gmail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cs8900.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 587f7f6..a9d1f22 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -321,15 +321,16 @@ int cs8900_initialize(u8 dev_num, int base_addr) memset(priv, 0, sizeof(*priv)); priv->regs = (struct cs8900_regs *)base_addr; - /* Load MAC address from EEPROM */ - cs8900_get_enetaddr(dev); - dev->iobase = base_addr; dev->priv = priv; dev->init = cs8900_init; dev->halt = cs8900_halt; dev->send = cs8900_send; dev->recv = cs8900_recv; + + /* Load MAC address from EEPROM */ + cs8900_get_enetaddr(dev); + sprintf(dev->name, "%s-%hu", CS8900_DRIVERNAME, dev_num); eth_register(dev); |