diff mbox

[U-Boot,v2,45/67] net: xilinx_axi_emac: Pull out init of struct eth_ops

Message ID 1353504238-11277-46-git-send-email-tmshlvck@gmail.com
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Commit Message

Tomas Hlavacek Nov. 21, 2012, 1:23 p.m. UTC
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/xilinx_axi_emac.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index 54a871b..44ece48 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -622,6 +622,15 @@  static int axiemac_bus_reset(struct mii_dev *bus)
 	return 0;
 }
 
+static struct eth_ops axiemac_ops = {
+	.init = axiemac_init,
+	.halt = axiemac_halt,
+	.send = axiemac_send,
+	.recv = axiemac_recv,
+	.write_hwaddr = axiemac_setup_mac
+};
+
+
 int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
 							unsigned long dma_addr)
 {
@@ -645,11 +654,7 @@  int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
 	priv->dmatx = (struct axidma_reg *)dma_addr;
 	/* RX channel offset is 0x30 */
 	priv->dmarx = (struct axidma_reg *)(dma_addr + 0x30);
-	dev->eo->init = axiemac_init;
-	dev->eo->halt = axiemac_halt;
-	dev->eo->send = axiemac_send;
-	dev->eo->recv = axiemac_recv;
-	dev->eo->write_hwaddr = axiemac_setup_mac;
+	dev->eo = &axiemac_ops;
 
 #ifdef CONFIG_PHY_ADDR
 	priv->phyaddr = CONFIG_PHY_ADDR;