Patchwork [U-Boot,v2,52/67] net: mpc8260_fec: Pull out init of struct eth_ops

login
register
mail settings
Submitter Tomas Hlavacek
Date Nov. 21, 2012, 1:23 p.m.
Message ID <1353504238-11277-53-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200731/
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Comments

Tomas Hlavacek - Nov. 21, 2012, 1:23 p.m.
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_fcc.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c b/arch/powerpc/cpu/mpc8260/ether_fcc.c
index 6b78235..c8dbc66 100644
--- a/arch/powerpc/cpu/mpc8260/ether_fcc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c
@@ -372,6 +372,13 @@  static void fec_halt(struct eth_device* dev)
 						~(FCC_GFMR_ENT | FCC_GFMR_ENR);
 }
 
+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;
@@ -385,10 +392,7 @@  int fec_initialize(bd_t *bis)
 		sprintf(dev->name, "FCC%d",
 			ether_fcc_info[i].ether_index + 1);
 		dev->priv = &ether_fcc_info[i];
-		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);