From patchwork Wed Nov 21 13:22:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,02/67] net: 4xx_enet: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:22:53 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200698 Message-Id: <1353504238-11277-3-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/4xx_enet.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 27b66dd..309e616 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -1905,6 +1905,13 @@ static int ppc_4xx_eth_rx (struct eth_device *dev) return length; } +static struct eth_ops ppc_4xx_eth_ops = { + .init = ppc_4xx_eth_init, + .send = ppc_4xx_eth_send, + .recv = ppc_4xx_eth_rx, + .halt = ppc_4xx_eth_halt +}; + int ppc_4xx_eth_initialize (bd_t * bis) { static int virgin = 0; @@ -2023,10 +2030,7 @@ int ppc_4xx_eth_initialize (bd_t * bis) sprintf (dev->name, "ppc_4xx_eth%d", eth_num - CONFIG_EMAC_NR_START); dev->priv = (void *) hw; - dev->eo->init = ppc_4xx_eth_init; - dev->eo->halt = ppc_4xx_eth_halt; - dev->eo->send = ppc_4xx_eth_send; - dev->eo->recv = ppc_4xx_eth_rx; + dev->eo = &ppc_4xx_eth_ops; eth_register(dev);