From patchwork Wed Nov 21 13:23:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,39/67] net: rtl8169: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:30 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200711 Message-Id: <1353504238-11277-40-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/rtl8169.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index c75fd4f..80f8443 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -872,6 +872,14 @@ static int rtl_init(struct eth_device *dev, bd_t *bis) return 1; } +static struct eth_ops rtl_ops = { + .init = rtl_reset, + .halt = rtl_halt, + .send = rtl_send, + .recv = rtl_recv +}; + + int rtl8169_initialize(bd_t *bis) { pci_dev_t devno; @@ -902,10 +910,7 @@ int rtl8169_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int)pci_mem_to_phys(devno, iobase); - dev->eo->init = rtl_reset; - dev->eo->halt = rtl_halt; - dev->eo->send = rtl_send; - dev->eo->recv = rtl_recv; + dev->eo = &rtl_ops; eth_register (dev);