[PATCH] bcm63xx: convert bcm63xx_enet to netdev ops.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch makes bcm63xx_enet driver use netdevice ops.

Signed-off-by: Maxime Bizon <mbizon@xxxxxxxxxx>
---
 drivers/net/bcm63xx_enet.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c
index 20e08ef..36324b3 100644
--- a/drivers/net/bcm63xx_enet.c
+++ b/drivers/net/bcm63xx_enet.c
@@ -1551,6 +1551,19 @@ static void bcm_enet_hw_preinit(struct bcm_enet_priv *priv)
 	enet_writel(priv, val, ENET_MIBCTL_REG);
 }
 
+static const struct net_device_ops bcm_enet_ops = {
+	.ndo_open		= bcm_enet_open,
+	.ndo_stop		= bcm_enet_stop,
+	.ndo_start_xmit		= bcm_enet_start_xmit,
+	.ndo_get_stats		= bcm_enet_get_stats,
+	.ndo_set_mac_address	= bcm_enet_set_mac_address,
+	.ndo_set_multicast_list = bcm_enet_set_multicast_list,
+	.ndo_do_ioctl		= bcm_enet_ioctl,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller = bcm_enet_netpoll,
+#endif
+};
+
 /*
  * allocate netdevice, request register memory and register device.
  */
@@ -1716,17 +1729,8 @@ static int __devinit bcm_enet_probe(struct platform_device *pdev)
 		enet_writel(priv, 0, ENET_MIB_REG(i));
 
 	/* register netdevice */
-	dev->open = bcm_enet_open;
-	dev->stop = bcm_enet_stop;
-	dev->hard_start_xmit = bcm_enet_start_xmit;
-	dev->get_stats = bcm_enet_get_stats;
-	dev->set_mac_address = bcm_enet_set_mac_address;
-	dev->set_multicast_list = bcm_enet_set_multicast_list;
+	dev->netdev_ops = &bcm_enet_ops;
 	netif_napi_add(dev, &priv->napi, bcm_enet_poll, 16);
-	dev->do_ioctl = bcm_enet_ioctl;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	dev->poll_controller = bcm_enet_netpoll;
-#endif
 
 	SET_ETHTOOL_OPS(dev, &bcm_enet_ethtool_ops);
 
-- 
1.6.0.4



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux