@@ -482,6 +482,14 @@ static int ethoc_recv(struct eth_device *dev)
return 0;
}
+static struct eth_ops ethoc_ops = {
+ .init = ethoc_init,
+ .halt = ethoc_halt,
+ .send = ethoc_send,
+ .recv = ethoc_recv,
+ .write_hwaddr = ethoc_set_mac_address
+};
+
int ethoc_initialize(u8 dev_num, int base_addr)
{
struct ethoc *priv;
@@ -499,11 +507,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
memset(dev, 0, sizeof(*dev));
dev->priv = priv;
dev->iobase = base_addr;
- dev->eo->init = ethoc_init;
- dev->eo->halt = ethoc_halt;
- dev->eo->send = ethoc_send;
- dev->eo->recv = ethoc_recv;
- dev->eo->write_hwaddr = ethoc_set_mac_address;
+ dev->eo = ðoc_ops;
sprintf(dev->name, "%s-%hu", "ETHOC", 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/ethoc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)