From patchwork Wed Nov 21 13:22:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,06/67] net: at91_emac: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:22:57 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200697 Message-Id: <1353504238-11277-7-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/at91_emac.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c index 3395dcc..464d539 100644 --- a/drivers/net/at91_emac.c +++ b/drivers/net/at91_emac.c @@ -494,6 +494,14 @@ static int at91emac_write_hwaddr(struct eth_device *netdev) return 0; } +static struct eth_ops at91emac_ops = { + .init = at91emac_init, + .halt = at91emac_halt, + .send = at91emac_send, + .recv = at91emac_recv, + .write_hwaddr = at91emac_write_hwaddr +}; + int at91emac_register(bd_t *bis, unsigned long iobase) { emac_device *emac; @@ -518,11 +526,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase) sprintf(dev->name, "emac"); dev->iobase = iobase; dev->priv = emacfix; - dev->eo->init = at91emac_init; - dev->eo->halt = at91emac_halt; - dev->eo->send = at91emac_send; - dev->eo->recv = at91emac_recv; - dev->eo->write_hwaddr = at91emac_write_hwaddr; + dev->eo = &at91emac_ops; eth_register(dev);