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

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 0a88bc0..8992b66 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -931,6 +931,13 @@ static int cpsw_phy_init(struct eth_device *dev, struct 
cpsw_slave *slave)
        return 1;
 }
 
+static struct eth_ops cpsw_ops = {
+       .init = cpsw_init,
+       .halt = cpsw_halt,
+       .send = cpsw_send,
+       .recv = cpsw_recv
+};
+
 int cpsw_register(struct cpsw_platform_data *data)
 {
        struct cpsw_priv        *priv;
@@ -974,11 +981,8 @@ int cpsw_register(struct cpsw_platform_data *data)
 
        strcpy(dev->name, "cpsw");
        dev->iobase     = 0;
-       dev->eo->init   = cpsw_init;
-       dev->eo->halt   = cpsw_halt;
-       dev->eo->send   = cpsw_send;
-       dev->eo->recv   = cpsw_recv;
-       dev->eo->priv   = priv;
+       dev->eo         = &cpsw_ops;
+       dev->priv       = priv;
 
        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