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

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

Comments

Tomas Hlavacek - Nov. 21, 2012, 1:23 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/xilinx_emaclite.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index c0fefa7..b5be0a3 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -345,6 +345,13 @@  static int emaclite_recv(struct eth_device *dev)
 
 }
 
+static struct eth_ops emaclite_ops = {
+	init = emaclite_init,
+	halt = emaclite_halt,
+	send = emaclite_send,
+	recv = emaclite_recv
+};
+
 int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
 							int txpp, int rxpp)
 {
@@ -369,10 +376,7 @@  int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
 	sprintf(dev->name, "Xelite.%lx", base_addr);
 
 	dev->iobase = base_addr;
-	dev->eo->init = emaclite_init;
-	dev->eo->halt = emaclite_halt;
-	dev->eo->send = emaclite_send;
-	dev->eo->recv = emaclite_recv;
+	dev->eo = &emaclite_ops;
 
 	eth_register(dev);