Patchwork [U-Boot,v2,56/67] net: db64360/mv_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-57-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200734/
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>
---
 board/Marvell/db64360/mv_eth.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/board/Marvell/db64360/mv_eth.c b/board/Marvell/db64360/mv_eth.c
index 226b964..a0aafc7 100644
--- a/board/Marvell/db64360/mv_eth.c
+++ b/board/Marvell/db64360/mv_eth.c
@@ -202,6 +202,13 @@  void db64360_eth_disable (struct eth_device *dev)
 }
 
 
+static struct eth_ops mv6436x_eth_ops = {
+	.init = (void *) db64360_eth_probe,
+	.halt = (void *) ethernet_phy_reset,
+	.send = (void *) db64360_eth_transmit,
+	.recv = (void *) db64360_eth_poll
+};
+
 void mv6436x_eth_initialize (bd_t * bis)
 {
 	struct eth_device *dev;
@@ -259,10 +266,7 @@  void mv6436x_eth_initialize (bd_t * bis)
 		/* ronen - set the MAC addr in the HW */
 		eth_port_uc_addr_set (devnum, dev->enetaddr, 0);
 
-		dev->eo->init = (void *) db64360_eth_probe;
-		dev->eo->halt = (void *) ethernet_phy_reset;
-		dev->eo->send = (void *) db64360_eth_transmit;
-		dev->eo->recv = (void *) db64360_eth_poll;
+		dev->eo = &mv6436x_eth_ops;
 
 		ethernet_private = calloc (sizeof (*ethernet_private), 1);
 		dev->priv = (void *) ethernet_private;