[U-Boot] [PATCH v2 61/67] net: p3mx/mv_eth: Pull out init of struct eth_ops

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:52 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/prodrive/p3mx/mv_eth.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/board/prodrive/p3mx/mv_eth.c b/board/prodrive/p3mx/mv_eth.c
index 69c2dba..cba749b 100644
--- a/board/prodrive/p3mx/mv_eth.c
+++ b/board/prodrive/p3mx/mv_eth.c
@@ -246,6 +246,13 @@ void mv_eth_phy_init (void)
 	MV_REG_WRITE (ETH_PHY_DFCDL_CONFIG0_REG, 0x300000);
 }
 
+static struct eth_ops db64460_eth_ops = {
+	.init = (void *) db64460_eth_probe,
+	.halt = (void *) ethernet_phy_reset,
+	.send = (void *) db64460_eth_transmit,
+	.recv = (void *) db64460_eth_poll
+};
+
 void mv6446x_eth_initialize (bd_t * bis)
 {
 	struct eth_device *dev;
@@ -309,10 +316,7 @@ void mv6446x_eth_initialize (bd_t * bis)
 		/* ronen - set the MAC addr in the HW */
 		eth_port_uc_addr_set (devnum, dev->enetaddr, 0);
 
-		dev->eo->init = (void *) db64460_eth_probe;
-		dev->eo->halt = (void *) ethernet_phy_reset;
-		dev->eo->send = (void *) db64460_eth_transmit;
-		dev->eo->recv = (void *) db64460_eth_poll;
+		dev->eo = &db64460_eth_ops;
 
 		ethernet_private = calloc (sizeof (*ethernet_private), 1);
 		dev->priv = (void *)ethernet_private;
-- 
1.7.2.5



More information about the U-Boot mailing list