[U-Boot] [PATCH v2 24/67] net: inca-ip_sw: Pull out init of struct eth_ops

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:15 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/inca-ip_sw.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

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);
 
-- 
1.7.2.5



More information about the U-Boot mailing list