diff mbox

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

Message ID 1353504238-11277-54-git-send-email-tmshlvck@gmail.com
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Commit Message

Tomas Hlavacek Nov. 21, 2012, 1:23 p.m. UTC
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@gmail.com>
---
 arch/powerpc/cpu/mpc8260/ether_scc.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
diff mbox

Patch

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