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

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:51 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>
---
 board/evb64260/eth.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c
index 783e0ae..6f4300d 100644
--- a/board/evb64260/eth.c
+++ b/board/evb64260/eth.c
@@ -664,6 +664,14 @@ gt6426x_eth_probe(void *v, bd_t *bis)
 	return 1;
 }
 
+
+static struct eth_ops gt6426x_eth_ops = {
+	.init = (void *) gt6426x_eth_probe,
+	.halt = (void *) gt6426x_eth_reset,
+	.send = (void *) gt6426x_eth_transmit,
+	.recv = (void *) gt6426x_eth_poll
+};
+
 /* enter all the galileo ethernet devs into MULTI-BOOT */
 void
 gt6426x_eth_initialize(bd_t *bis)
@@ -720,10 +728,7 @@ gt6426x_eth_initialize(bd_t *bis)
 				s = (*e) ? e+1 : e;
 		}
 
-		dev->eo->init = (void *)gt6426x_eth_probe;
-		dev->eo->halt = (void *)gt6426x_eth_reset;
-		dev->eo->send = (void *)gt6426x_eth_transmit;
-		dev->eo->recv = (void *)gt6426x_eth_poll;
+		dev->eo = &gt6426x_eth_ops;
 
 		p = calloc( sizeof(*p), 1 );
 		dev->priv = (void*)p;
-- 
1.7.2.5



More information about the U-Boot mailing list