From patchwork Fri Nov 2 17:18:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,11/50] net: cs8900: Pull out init of struct eth_ops Date: Fri, 02 Nov 2012 07:18:03 -0000 From: Tomas Hlavacek X-Patchwork-Id: 196638 Message-Id: <1351876722-5183-12-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de 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 --- drivers/net/cs8900.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 65a4254..a78eada 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -299,6 +299,13 @@ int cs8900_e2prom_write(struct eth_device *dev, u8 addr, u16 value) return 0; } +static struct eth_ops cs8900_ops = { + .init = cs8900_init, + .halt = cs8900_halt, + .send = cs8900_send, + .recv = cs8900_recv +}; + int cs8900_initialize(u8 dev_num, int base_addr) { struct eth_device *dev; @@ -320,10 +327,7 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->eo->init = cs8900_init; - dev->eo->halt = cs8900_halt; - dev->eo->send = cs8900_send; - dev->eo->recv = cs8900_recv; + dev->eo = &cs8900_ops; /* Load MAC address from EEPROM */ cs8900_get_enetaddr(dev);