public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cs8900 assign dev->priv before using it
@ 2009-10-29  8:49 Hui.Tang
  2009-10-29 17:05 ` Ben Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Hui.Tang @ 2009-10-29  8:49 UTC (permalink / raw)
  To: u-boot

cs8900_get_enetaddr() call get_reg_init_bus(), which will use dev->priv in CONFIG_CS8900_BUS16 config, so we should assign dev->priv before using it.

---
 drivers/net/cs8900.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index 587f7f6..962b74c 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -320,12 +320,12 @@ int cs8900_initialize(u8 dev_num, int base_addr)
 	}
 	memset(priv, 0, sizeof(*priv));
 	priv->regs = (struct cs8900_regs *)base_addr;
+	dev->priv = priv;
 
 	/* 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;
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-30  4:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29  8:49 [U-Boot] [PATCH] cs8900 assign dev->priv before using it Hui.Tang
2009-10-29 17:05 ` Ben Warren
2009-10-30  4:13   ` Hui Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox