Patchwork [U-Boot,v2,29/67] net: mpc5xxx_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-30-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200738/
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>
---
 drivers/net/mpc5xxx_fec.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
index 73503da..50f8100 100644
--- a/drivers/net/mpc5xxx_fec.c
+++ b/drivers/net/mpc5xxx_fec.c
@@ -879,6 +879,12 @@  static int mpc5xxx_fec_recv(struct eth_device *dev)
 	return len;
 }
 
+static struct eth_ops mpc5xxx_fec_ops = {
+	.init = mpc5xxx_fec_init,
+	.halt = mpc5xxx_fec_halt,
+	.send = mpc5xxx_fec_send,
+	.recv = mpc5xxx_fec_recv
+};
 
 /********************************************************************/
 int mpc5xxx_fec_initialize(bd_t * bis)
@@ -915,10 +921,7 @@  int mpc5xxx_fec_initialize(bd_t * bis)
 
 	dev->priv = (void *)fec;
 	dev->iobase = MPC5XXX_FEC;
-	dev->eo->init = mpc5xxx_fec_init;
-	dev->eo->halt = mpc5xxx_fec_halt;
-	dev->eo->send = mpc5xxx_fec_send;
-	dev->eo->recv = mpc5xxx_fec_recv;
+	dev->eo = &mpc5xxx_fec_ops;
 
 	sprintf(dev->name, "FEC");
 	eth_register(dev);