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/dm9000x.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index bd96948..f6b226c 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -623,6 +623,13 @@ dm9000_phy_write(int reg, u16 value)
        DM9000_DBG("dm9000_phy_write(reg:0x%x, value:0x%x)\n", reg, value);
 }
 
+static struct eth_ops dm9000_ops = {
+       .init = dm9000_init,
+       .send = dm9000_send,
+       .recv = dm9000_rx,
+       .halt = dm9000_halt
+};
+
 int dm9000_initialize(bd_t *bis)
 {
        struct eth_device *dev = &(dm9000_info.netdev);
@@ -630,10 +637,7 @@ int dm9000_initialize(bd_t *bis)
        /* Load MAC address from EEPROM */
        dm9000_get_enetaddr(dev);
 
-       dev->eo->init = dm9000_init;
-       dev->eo->halt = dm9000_halt;
-       dev->eo->send = dm9000_send;
-       dev->eo->recv = dm9000_rx;
+       dev->eo = &dm9000_ops;
        sprintf(dev->name, "dm9000");
 
        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