Patchwork [U-Boot,v2,43/67] net: tsi108_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-44-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200725/
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/tsi108_eth.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index bed09d5..ea26c2c 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -718,6 +718,13 @@  static int marvell_88e_phy_config (struct eth_device *dev, int *speed,
 	return 1;
 }
 
+static struct eth_ops tsi108_eth_ops = {
+	.init = tsi108_eth_probe,
+	.halt = tsi108_eth_halt,
+	.send = tsi108_eth_send,
+	.recv = tsi108_eth_recv
+};
+
 /*
  * External interface
  *
@@ -739,10 +746,7 @@  int tsi108_eth_initialize (bd_t * bis)
 
 		dev->iobase = ETH_BASE + (index * ETH_PORT_OFFSET);
 		dev->priv = (void *)(phy_address[index]);
-		dev->eo->init = tsi108_eth_probe;
-		dev->eo->halt = tsi108_eth_halt;
-		dev->eo->send = tsi108_eth_send;
-		dev->eo->recv = tsi108_eth_recv;
+		dev->eo = &tsi108_eth_ops;
 
 		eth_register(dev);
 	}