[U-Boot] [RFC PATCH 46/50] net: xilinx_axi_emac: Pull out init of struct eth_ops
Tomas Hlavacek
tmshlvck at gmail.com
Fri Nov 2 18:18:38 CET 2012
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 at gmail.com>
---
drivers/net/xilinx_axi_emac.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
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;
--
1.7.10.4
More information about the U-Boot
mailing list