From patchwork Fri Nov 2 17:18:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,26/50] net: ks8695eth: Pull out init of struct eth_ops Date: Fri, 02 Nov 2012 07:18:18 -0000 From: Tomas Hlavacek X-Patchwork-Id: 196670 Message-Id: <1351876722-5183-27-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/ks8695eth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ks8695eth.c b/drivers/net/ks8695eth.c index b0703ef..4a5a27e 100644 --- a/drivers/net/ks8695eth.c +++ b/drivers/net/ks8695eth.c @@ -220,6 +220,13 @@ static int ks8695_eth_send(struct eth_device *dev, void *packet, int len) /****************************************************************************/ +static struct eth_ops ks8695_eth_ops = { + .init = ks8695_eth_init, + .halt = ks8695_eth_halt, + .send = ks8695_eth_send, + .recv = ks8695_eth_recv +}; + int ks8695_eth_initialize(void) { struct eth_device *dev; @@ -230,10 +237,7 @@ int ks8695_eth_initialize(void) memset(dev, 0, sizeof(*dev)); dev->iobase = KS8695_IO_BASE + KS8695_LAN_DMA_TX; - dev->eo->init = ks8695_eth_init; - dev->eo->halt = ks8695_eth_halt; - dev->eo->send = ks8695_eth_send; - dev->eo->recv = ks8695_eth_recv; + dev->eo = &ks8695_eth_ops; strcpy(dev->name, "ks8695eth"); eth_register(dev);