Patchwork [U-Boot,v2,63/67] net: fm_eth: 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-64-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200740/
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/fm/eth.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 8d881d4..d148957 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -611,6 +611,13 @@  static int init_phy(struct eth_device *dev)
 	return 0;
 }
 
+static struct eth_ops fm_eth_ops = {
+	.init = fm_eth_open,
+	.halt = fm_eth_halt,
+	.send = fm_eth_send,
+	.recv = fm_eth_recv
+};
+
 int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
 {
 	struct eth_device *dev;
@@ -653,10 +660,7 @@  int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
 	devlist[num_controllers++] = dev;
 	dev->iobase = 0;
 	dev->priv = (void *)fm_eth;
-	dev->eo->init = fm_eth_open;
-	dev->eo->halt = fm_eth_halt;
-	dev->eo->send = fm_eth_send;
-	dev->eo->recv = fm_eth_recv;
+	dev->eo = &fm_eth_ops;
 	fm_eth->dev = dev;
 	fm_eth->bus = info->bus;
 	fm_eth->phyaddr = info->phy_addr;