@@ -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);
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 <tmshlvck@gmail.com> --- drivers/net/rtl8169.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)