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

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:48 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/mpc8xx/fec.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c
index 5934d92..5544f20 100644
--- a/arch/powerpc/cpu/mpc8xx/fec.c
+++ b/arch/powerpc/cpu/mpc8xx/fec.c
@@ -147,6 +147,13 @@ static void fec_halt(struct eth_device* dev);
 static void __mii_init(void);
 #endif
 
+static struct eth_ops fec_ops = {
+	.init = fec_init,
+	.halt = fec_halt,
+	.send = fec_send,
+	.recv = fec_recv
+};
+
 int fec_initialize(bd_t *bis)
 {
 	struct eth_device* dev;
@@ -178,10 +185,7 @@ int fec_initialize(bd_t *bis)
 		efis->actual_phy_addr = -1;
 
 		dev->priv = efis;
-		dev->eo->init = fec_init;
-		dev->eo->halt = fec_halt;
-		dev->eo->send = fec_send;
-		dev->eo->recv = fec_recv;
+		dev->eo = &fec_ops;
 
 		eth_register(dev);
 
-- 
1.7.2.5



More information about the U-Boot mailing list