From patchwork Wed Nov 21 13:23:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,63/67] net: fm_eth: Pull out init of struct eth_ops From: Tomas Hlavacek X-Patchwork-Id: 200740 Message-Id: <1353504238-11277-64-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de Date: Wed, 21 Nov 2012 14:23:54 +0100 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/fm/eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index 8d881d4..d148957 100644 --- a/drivers/net/fm/eth.c +++ b/drivers/net/fm/eth.c @@ -611,6 +611,13 @@ static int init_phy(struct eth_device *dev) return 0; } +static struct eth_ops fm_eth_ops = { + .init = fm_eth_open, + .halt = fm_eth_halt, + .send = fm_eth_send, + .recv = fm_eth_recv +}; + int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) { struct eth_device *dev; @@ -653,10 +660,7 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) devlist[num_controllers++] = dev; dev->iobase = 0; dev->priv = (void *)fm_eth; - dev->eo->init = fm_eth_open; - dev->eo->halt = fm_eth_halt; - dev->eo->send = fm_eth_send; - dev->eo->recv = fm_eth_recv; + dev->eo = &fm_eth_ops; fm_eth->dev = dev; fm_eth->bus = info->bus; fm_eth->phyaddr = info->phy_addr;