From patchwork Fri Nov 2 17:18:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,21/50] net: fec_mxc: Pull out init of struct eth_ops Date: Fri, 02 Nov 2012 07:18:13 -0000 From: Tomas Hlavacek X-Patchwork-Id: 196644 Message-Id: <1351876722-5183-22-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/fec_mxc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index f8a5556..3259f07 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -915,6 +915,15 @@ static int fec_recv(struct eth_device *dev) return len; } +static struct eth_ops fec_ops = { + .init = fec_init, + .send = fec_send, + .recv = fec_recv, + .halt = fec_halt, + .write_hwaddr = fec_set_hwaddr +}; + + static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) { struct eth_device *edev; @@ -943,11 +952,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) memset(fec, 0, sizeof(*fec)); edev->priv = fec; - edev->eo->init = fec_init; - edev->eo->send = fec_send; - edev->eo->recv = fec_recv; - edev->eo->halt = fec_halt; - edev->eo->write_hwaddr = fec_set_hwaddr; + edev->eo = &fec_ops; fec->eth = (struct ethernet_regs *)base_addr; fec->bd = bd;