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 <tmshl...@gmail.com>
---
 drivers/net/4xx_enet.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c
index 27b66dd..309e616 100644
--- a/drivers/net/4xx_enet.c
+++ b/drivers/net/4xx_enet.c
@@ -1905,6 +1905,13 @@ static int ppc_4xx_eth_rx (struct eth_device *dev)
        return length;
 }
 
+static struct eth_ops ppc_4xx_eth_ops = {
+       .init = ppc_4xx_eth_init,
+       .send = ppc_4xx_eth_send,
+       .recv = ppc_4xx_eth_rx,
+       .halt = ppc_4xx_eth_halt
+};
+
 int ppc_4xx_eth_initialize (bd_t * bis)
 {
        static int virgin = 0;
@@ -2023,10 +2030,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
 
                sprintf (dev->name, "ppc_4xx_eth%d", eth_num - 
CONFIG_EMAC_NR_START);
                dev->priv = (void *) hw;
-               dev->eo->init = ppc_4xx_eth_init;
-               dev->eo->halt = ppc_4xx_eth_halt;
-               dev->eo->send = ppc_4xx_eth_send;
-               dev->eo->recv = ppc_4xx_eth_rx;
+               dev->eo = &ppc_4xx_eth_ops;
 
                eth_register(dev);
 
-- 
1.7.10.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to