From patchwork Fri Nov 2 17:18:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,43/50] net: tsec: Pull out init of struct eth_ops Date: Fri, 02 Nov 2012 07:18:35 -0000 From: Tomas Hlavacek X-Patchwork-Id: 196666 Message-Id: <1351876722-5183-44-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/tsec.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 345d563..034f0ed 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -605,6 +605,16 @@ static int init_phy(struct eth_device *dev) return 1; } +static struct eth_ops tsec_ops = { + .init = tsec_init, + .halt = tsec_halt, + .send = tsec_send, + .recv = tsec_recv, +#ifdef CONFIG_MCAST_TFTP + .mcast = tsec_mcast_addr +#endif +}; + /* Initialize device structure. Returns success if PHY * initialization succeeded (i.e. if it recognizes the PHY) */ @@ -638,13 +648,7 @@ static int tsec_initialize(bd_t *bis, struct tsec_info_struct *tsec_info) priv->bus = miiphy_get_dev_by_name(tsec_info->mii_devname); dev->iobase = 0; dev->priv = priv; - dev->eo->init = tsec_init; - dev->eo->halt = tsec_halt; - dev->eo->send = tsec_send; - dev->eo->recv = tsec_recv; -#ifdef CONFIG_MCAST_TFTP - dev->eo->mcast = tsec_mcast_addr; -#endif + dev->eo = &tsec_ops; /* Tell u-boot to get the addr from the env */ for (i = 0; i < 6; i++)