[U-Boot] [RFC PATCH 07/50] net: ax88180: Pull out init of struct eth_ops

Tomas Hlavacek tmshlvck at gmail.com
Fri Nov 2 18:17:59 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/ax88180.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ax88180.c b/drivers/net/ax88180.c
index 464f261..fc237ba 100644
--- a/drivers/net/ax88180.c
+++ b/drivers/net/ax88180.c
@@ -698,6 +698,14 @@ static void ax88180_read_mac_addr (struct eth_device *dev)
 	}
 }
 
+static struct eth_ops ax88180_ops = {
+	.init = ax88180_init,
+	.halt = ax88180_halt,
+	.send = ax88180_send,
+	.recv = ax88180_recv
+};
+
+
 /*
 ===========================================================================
 <<<<<<			Exported SubProgram Bodies		>>>>>>
@@ -725,10 +733,7 @@ int ax88180_initialize (bd_t * bis)
 	sprintf (dev->name, "ax88180");
 	dev->iobase = AX88180_BASE;
 	dev->priv = priv;
-	dev->eo->init = ax88180_init;
-	dev->eo->halt = ax88180_halt;
-	dev->eo->send = ax88180_send;
-	dev->eo->recv = ax88180_recv;
+	dev->eo = &ax88180_ops;
 
 	priv->BusWidth = BUS_WIDTH_32;
 	priv->PadSize = 3;
-- 
1.7.10.4



More information about the U-Boot mailing list