From patchwork Wed Nov 21 13:23:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,38/67] net: rtl8139: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:29 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200751 Message-Id: <1353504238-11277-39-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/rtl8139.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index ed02cf6..0e4e5d5 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -200,6 +200,16 @@ static struct pci_device_id supported[] = { {} }; +static struct eth_ops rtl8139_ops = { + .init = rtl8139_probe, + .halt = rtl_disable, + .send = rtl_transmit, + .recv = rtl_poll, +#ifdef CONFIG_MCAST_TFTP + .mcast = rtl_bcast_addr +#endif +}; + int rtl8139_initialize(bd_t *bis) { pci_dev_t devno; @@ -229,13 +239,7 @@ int rtl8139_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int)bus_to_phys(iobase); - dev->eo->init = rtl8139_probe; - dev->eo->halt = rtl_disable; - dev->eo->send = rtl_transmit; - dev->eo->recv = rtl_poll; -#ifdef CONFIG_MCAST_TFTP - dev->eo->mcast = rtl_bcast_addr; -#endif + dev->eo = &rtl8139_ops; eth_register (dev);