Comments
Patch
@@ -525,6 +525,13 @@ static int ftgmac100_send(struct eth_device *dev, void *packet, int length)
return 0;
}
+static struct eth_ops ftgmac100_ops = {
+ .init = ftgmac100_init,
+ .halt = ftgmac100_halt,
+ .send = ftgmac100_send,
+ .recv = ftgmac100_recv
+};
+
int ftgmac100_initialize(bd_t *bd)
{
struct eth_device *dev;
@@ -548,10 +555,7 @@ int ftgmac100_initialize(bd_t *bd)
sprintf(dev->name, "FTGMAC100");
dev->iobase = CONFIG_FTGMAC100_BASE;
- dev->eo->init = ftgmac100_init;
- dev->eo->halt = ftgmac100_halt;
- dev->eo->send = ftgmac100_send;
- dev->eo->recv = ftgmac100_recv;
+ dev->eo = &ftgmac100_ops;
dev->priv = priv;
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/ftgmac100.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)