@@ -529,6 +529,14 @@ static int macb_write_hwaddr(struct eth_device *dev)
return 0;
}
+static struct eth_ops macb_ops = {
+ .init = macb_init,
+ .halt = macb_halt,
+ .send = macb_send,
+ .recv = macb_recv,
+ .write_hwaddr = macb_write_hwaddr
+};
+
int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
{
struct macb_device *macb;
@@ -558,11 +566,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
macb->phy_addr = phy_addr;
sprintf(netdev->name, "macb%d", id);
- netdev->eo->init = macb_init;
- netdev->eo->halt = macb_halt;
- netdev->eo->send = macb_send;
- netdev->eo->recv = macb_recv;
- netdev->eo->write_hwaddr = macb_write_hwaddr;
+ netdev->eo = &macb_ops;
/*
* Do some basic initialization so that we at least can talk
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/macb.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)