[U-Boot,RFC,44/50] net: tsi108_eth: Pull out init of struct eth_ops

Submitted by Tomas Hlavacek on Nov. 2, 2012, 5:18 p.m.

Details

Message ID 1351876722-5183-45-git-send-email-tmshlvck@gmail.com
State Superseded
Delegated to: Joe Hershberger
Headers show

Commit Message

Tomas Hlavacek Nov. 2, 2012, 5:18 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 file changed, 8 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

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