[U-Boot] [PATCH v2 18/67] net: ep93xx_eth: Pull out init of struct eth_ops

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:09 CET 2012


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 at gmail.com>
---
 drivers/net/ep93xx_eth.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ep93xx_eth.c b/drivers/net/ep93xx_eth.c
index 0b5cb3c..a2a1502 100644
--- a/drivers/net/ep93xx_eth.c
+++ b/drivers/net/ep93xx_eth.c
@@ -439,6 +439,13 @@ int ep93xx_miiphy_initialize(bd_t * const bd)
 }
 #endif
 
+static struct eth_dev ep93xx_eth_ops = {
+	.init = ep93xx_eth_open,
+	.halt = ep93xx_eth_close,
+	.send = ep93xx_eth_send_packet,
+	.recv = ep93xx_eth_rcv_packet
+};
+
 /**
  * Initialize the EP93xx MAC.  The MAC hardware is reset.  Buffers are
  * allocated, if necessary, for the TX and RX descriptor and status queues,
@@ -499,10 +506,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr)
 
 	dev->iobase = base_addr;
 	dev->priv = priv;
-	dev->eo->init = ep93xx_eth_open;
-	dev->eo->halt = ep93xx_eth_close;
-	dev->eo->send = ep93xx_eth_send_packet;
-	dev->eo->recv = ep93xx_eth_rcv_packet;
+	dev->eo = &ep93xx_eth_ops;
 
 	sprintf(dev->name, "ep93xx_eth-%hu", dev_num);
 
-- 
1.7.2.5



More information about the U-Boot mailing list