From patchwork Wed Nov 21 13:23:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,09/67] net: calxedaxgmac: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:00 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200695 Message-Id: <1353504238-11277-10-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de 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 --- drivers/net/calxedaxgmac.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/calxedaxgmac.c b/drivers/net/calxedaxgmac.c index 2346feb..3550160 100644 --- a/drivers/net/calxedaxgmac.c +++ b/drivers/net/calxedaxgmac.c @@ -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);