Patchwork [U-Boot,v2,07/67] net: ax88180: Pull out init of struct eth_ops

login
register
mail settings
Submitter Tomas Hlavacek
Date Nov. 21, 2012, 1:22 p.m.
Message ID <1353504238-11277-8-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200702/
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Comments

Tomas Hlavacek - Nov. 21, 2012, 1:22 p.m.
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/ax88180.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

Patch

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;