[U-Boot] [PATCH v2 50/67] net: au1x00_eth: Pull out init of struct eth_ops

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:41 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>
---
 arch/mips/cpu/mips32/au1x00/au1x00_eth.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
index 2909fb3..cd4c518 100644
--- a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
+++ b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
@@ -283,6 +283,13 @@ static void au1x00_halt(struct eth_device* dev){
 	*macen = 0;
 }
 
+static struct eth_ops au1x00_ops = {
+	.init = au1x00_init,
+	.halt = au1x00_halt,
+	.send = au1x00_send,
+	.recv = au1x00_recv
+};
+
 int au1x00_enet_initialize(bd_t *bis){
 	struct eth_device* dev;
 
@@ -296,10 +303,7 @@ int au1x00_enet_initialize(bd_t *bis){
 	sprintf(dev->name, "Au1X00 ethernet");
 	dev->iobase = 0;
 	dev->priv = 0;
-	dev->eo->init = au1x00_init;
-	dev->eo->halt = au1x00_halt;
-	dev->eo->send = au1x00_send;
-	dev->eo->recv = au1x00_recv;
+	dev->eo = &au1x00_ops;
 
 	eth_register(dev);
 
-- 
1.7.2.5



More information about the U-Boot mailing list