From patchwork Wed Nov 21 13:23:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,14/67] net: dnet: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:05 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200699 Message-Id: <1353504238-11277-15-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/dnet.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index be0891f..126828e 100644 --- a/drivers/net/dnet.c +++ b/drivers/net/dnet.c @@ -355,6 +355,13 @@ static void dnet_halt(struct eth_device *netdev) dnet_writew_mac(dnet, DNET_INTERNAL_MODE_REG, 0); } +static struct eth_ops dnet_ops = { + .init = dnet_init, + .halt = dnet_halt, + .send = dnet_send, + .recv = dnet_recv +}; + int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) { struct dnet_device *dnet; @@ -374,10 +381,7 @@ int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) dnet->phy_addr = phy_addr; sprintf(netdev->name, "dnet%d", id); - netdev->eo->init = dnet_init; - netdev->eo->halt = dnet_halt; - netdev->eo->send = dnet_send; - netdev->eo->recv = dnet_recv; + netdev->eo = &dnet_ops; dev_capa = readl(&dnet->regs->VERCAPS) & 0xFFFF; debug("%s: has %smdio, %sirq, %sgigabit, %sdma\n", netdev->name,