From patchwork Wed Nov 21 13:23:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,19/67] net: ethoc: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:10 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200721 Message-Id: <1353504238-11277-20-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/ethoc.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 946b8e2..6a78605 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c @@ -482,6 +482,14 @@ static int ethoc_recv(struct eth_device *dev) return 0; } +static struct eth_ops ethoc_ops = { + .init = ethoc_init, + .halt = ethoc_halt, + .send = ethoc_send, + .recv = ethoc_recv, + .write_hwaddr = ethoc_set_mac_address +}; + int ethoc_initialize(u8 dev_num, int base_addr) { struct ethoc *priv; @@ -499,11 +507,7 @@ int ethoc_initialize(u8 dev_num, int base_addr) memset(dev, 0, sizeof(*dev)); dev->priv = priv; dev->iobase = base_addr; - dev->eo->init = ethoc_init; - dev->eo->halt = ethoc_halt; - dev->eo->send = ethoc_send; - dev->eo->recv = ethoc_recv; - dev->eo->write_hwaddr = ethoc_set_mac_address; + dev->eo = ðoc_ops; sprintf(dev->name, "%s-%hu", "ETHOC", dev_num); eth_register(dev);