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/ethoc.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 946b8e2..6a78605 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -482,6 +482,14 @@ static int ethoc_recv(struct eth_device *dev)
        return 0;
 }
 
+static struct eth_ops ethoc_ops = {
+       .init = ethoc_init,
+       .halt = ethoc_halt,
+       .send = ethoc_send,
+       .recv = ethoc_recv,
+       .write_hwaddr = ethoc_set_mac_address
+};
+
 int ethoc_initialize(u8 dev_num, int base_addr)
 {
        struct ethoc *priv;
@@ -499,11 +507,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
        memset(dev, 0, sizeof(*dev));
        dev->priv = priv;
        dev->iobase = base_addr;
-       dev->eo->init = ethoc_init;
-       dev->eo->halt = ethoc_halt;
-       dev->eo->send = ethoc_send;
-       dev->eo->recv = ethoc_recv;
-       dev->eo->write_hwaddr = ethoc_set_mac_address;
+       dev->eo = &ethoc_ops;
        sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
 
        eth_register(dev);
-- 
1.7.2.5

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

Reply via email to