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

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

diff --git a/arch/powerpc/cpu/mpc8260/ether_scc.c b/arch/powerpc/cpu/mpc8260/ether_scc.c
index e56bfdf..5afe905 100644
--- a/arch/powerpc/cpu/mpc8260/ether_scc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_scc.c
@@ -364,6 +364,13 @@ static void sec_restart(void)
 }
 #endif
 
+static struct eth_ops sec_ops = {
+	.init = sec_init,
+	.halt = sec_halt,
+	.send = sec_send,
+	.recv = sec_rx
+};
+
 int mpc82xx_scc_enet_initialize(bd_t *bis)
 {
 	struct eth_device *dev;
@@ -372,10 +379,7 @@ int mpc82xx_scc_enet_initialize(bd_t *bis)
 	memset(dev, 0, sizeof *dev);
 
 	sprintf(dev->name, "SCC");
-	dev->eo->init   = sec_init;
-	dev->eo->halt   = sec_halt;
-	dev->eo->send   = sec_send;
-	dev->eo->recv   = sec_rx;
+	dev->eo = &sec_ops;
 
 	eth_register(dev);
 
-- 
1.7.2.5



More information about the U-Boot mailing list