Patchwork [U-Boot,v2,24/67] net: inca-ip_sw: 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-25-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200735/
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/inca-ip_sw.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/inca-ip_sw.c b/drivers/net/inca-ip_sw.c
index 216122d..ab91553 100644
--- a/drivers/net/inca-ip_sw.c
+++ b/drivers/net/inca-ip_sw.c
@@ -165,6 +165,12 @@  static void inca_init_switch_chip(void);
 static void inca_dma_init(void);
 static int inca_amdix(void);
 
+static struct eth_ops inca_switch_ops = {
+	.init = inca_switch_init,
+	.halt = inca_switch_halt,
+	.send = inca_switch_send,
+	.recv = inca_switch_recv
+};
 
 int inca_switch_initialize(bd_t * bis)
 {
@@ -189,10 +195,7 @@  int inca_switch_initialize(bd_t * bis)
 #endif
 
 	sprintf(dev->name, "INCA-IP Switch");
-	dev->eo->init = inca_switch_init;
-	dev->eo->halt = inca_switch_halt;
-	dev->eo->send = inca_switch_send;
-	dev->eo->recv = inca_switch_recv;
+	dev->eo = &inca_switch_ops;
 
 	eth_register(dev);