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

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

diff --git a/arch/powerpc/cpu/mpc8220/fec.c b/arch/powerpc/cpu/mpc8220/fec.c
index 9d6fcc1..289e7c2 100644
--- a/arch/powerpc/cpu/mpc8220/fec.c
+++ b/arch/powerpc/cpu/mpc8220/fec.c
@@ -799,6 +799,12 @@ static int mpc8220_fec_recv (struct eth_device *dev)
 	return len;
 }
 
+static struct eth_ops mpc8220_fec_ops = {
+	.init = mpc8220_fec_init,
+	.halt = mpc8220_fec_halt,
+	.send = mpc8220_fec_send,
+	.recv = mpc8220_fec_recv
+};
 
 /********************************************************************/
 int mpc8220_fec_initialize (bd_t * bis)
@@ -833,10 +839,7 @@ int mpc8220_fec_initialize (bd_t * bis)
 
 	dev->priv = (void *) fec;
 	dev->iobase = MMAP_FEC1;
-	dev->eo->init = mpc8220_fec_init;
-	dev->eo->halt = mpc8220_fec_halt;
-	dev->eo->send = mpc8220_fec_send;
-	dev->eo->recv = mpc8220_fec_recv;
+	dev->eo = &mpc8220_fec_ops;
 
 	sprintf (dev->name, "FEC");
 	eth_register (dev);
-- 
1.7.2.5



More information about the U-Boot mailing list