@@ -1331,6 +1331,14 @@ static void print_packet( byte * buf, int length )
}
#endif
+static struct eth_ops smc_ops = {
+ .init = smc_init,
+ .halt = smc_halt,
+ .send = smc_send,
+ .recv = smc_rcv,
+ .write_hwaddr = smc_write_hwaddr
+};
+
int smc91111_initialize(u8 dev_num, int base_addr)
{
struct smc91111_priv *priv;
@@ -1357,11 +1365,7 @@ int smc91111_initialize(u8 dev_num, int base_addr)
dev->enetaddr[i] = SMC_inb(dev, (ADDR0_REG + i));
swap_to(FLASH);
- dev->eo->init = smc_init;
- dev->eo->halt = smc_halt;
- dev->eo->send = smc_send;
- dev->eo->recv = smc_rcv;
- dev->eo->write_hwaddr = smc_write_hwaddr;
+ dev->eo = &smc_ops;
sprintf(dev->name, "%s-%hu", SMC_DEV_NAME, dev_num);
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/smc91111.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)