diff mbox

[U-Boot,v2,10/67] net: cs8900: Pull out init of struct eth_ops

Message ID 1353504238-11277-11-git-send-email-tmshlvck@gmail.com
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Commit Message

Tomas Hlavacek Nov. 21, 2012, 1:23 p.m. UTC
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
---
 drivers/net/cs8900.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index 65a4254..a78eada 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -299,6 +299,13 @@  int cs8900_e2prom_write(struct eth_device *dev, u8 addr, u16 value)
 	return 0;
 }
 
+static struct eth_ops cs8900_ops = {
+	.init = cs8900_init,
+	.halt = cs8900_halt,
+	.send = cs8900_send,
+	.recv = cs8900_recv
+};
+
 int cs8900_initialize(u8 dev_num, int base_addr)
 {
 	struct eth_device *dev;
@@ -320,10 +327,7 @@  int cs8900_initialize(u8 dev_num, int base_addr)
 
 	dev->iobase = base_addr;
 	dev->priv = priv;
-	dev->eo->init = cs8900_init;
-	dev->eo->halt = cs8900_halt;
-	dev->eo->send = cs8900_send;
-	dev->eo->recv = cs8900_recv;
+	dev->eo = &cs8900_ops;
 
 	/* Load MAC address from EEPROM */
 	cs8900_get_enetaddr(dev);