From patchwork Wed Nov 21 13:23:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,27/67] net: macb: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:18 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200758 Message-Id: <1353504238-11277-28-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/macb.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 2c53902..c0f1202 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -529,6 +529,14 @@ static int macb_write_hwaddr(struct eth_device *dev) return 0; } +static struct eth_ops macb_ops = { + .init = macb_init, + .halt = macb_halt, + .send = macb_send, + .recv = macb_recv, + .write_hwaddr = macb_write_hwaddr +}; + int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) { struct macb_device *macb; @@ -558,11 +566,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) macb->phy_addr = phy_addr; sprintf(netdev->name, "macb%d", id); - netdev->eo->init = macb_init; - netdev->eo->halt = macb_halt; - netdev->eo->send = macb_send; - netdev->eo->recv = macb_recv; - netdev->eo->write_hwaddr = macb_write_hwaddr; + netdev->eo = &macb_ops; /* * Do some basic initialization so that we at least can talk