@@ -508,6 +508,15 @@ static void xgmac_halt(struct eth_device *dev)
priv->rx_currdesc = 0;
}
+static struct eth_ops xgmac_ops = {
+ .init = xgmac_init,
+ .send = xgmac_tx,
+ .recv = xgmac_rx,
+ .halt = xgmac_halt
+};
+
+
+
int calxedaxgmac_initialize(u32 id, ulong base_addr)
{
struct eth_device *dev;
@@ -543,10 +552,7 @@ int calxedaxgmac_initialize(u32 id, ulong base_addr)
macaddr[0] = readl(®s->macaddr[0].lo);
memcpy(dev->enetaddr, macaddr, 6);
- dev->eo->init = xgmac_init;
- dev->eo->send = xgmac_tx;
- dev->eo->recv = xgmac_rx;
- dev->eo->halt = xgmac_halt;
+ dev->eo = &xgmac_ops;
eth_register(dev);
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@gmail.com> --- drivers/net/calxedaxgmac.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)