diff mbox

[32/33] niu: convert to net_device_ops

Message ID 20081117234357.517904432@vyatta.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger Nov. 17, 2008, 11:42 p.m. UTC
Convert this driver to network device ops. Compile tested only (give me hw!)

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Comments

David Miller Nov. 20, 2008, 6:28 a.m. UTC | #1
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 17 Nov 2008 15:42:39 -0800

> Convert this driver to network device ops. Compile tested only (give me hw!)
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Hehe, applied :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/net/niu.c	2008-11-17 13:45:41.000000000 -0800
+++ b/drivers/net/niu.c	2008-11-17 13:48:46.000000000 -0800
@@ -8618,19 +8618,24 @@  static struct net_device * __devinit niu
 	return dev;
 }
 
+static const struct net_device_ops niu_netdev_ops = {
+	.open			= niu_open,
+	.stop			= niu_close,
+	.get_stats		= niu_get_stats,
+	.set_multicast_list	= niu_set_rx_mode,
+	.validate_addr		= eth_validate_addr,
+	.set_mac_address	= niu_set_mac_addr,
+	.do_ioctl		= niu_ioctl,
+	.tx_timeout		= niu_tx_timeout,
+	.change_mtu		= niu_change_mtu,
+};
+
 static void __devinit niu_assign_netdev_ops(struct net_device *dev)
 {
-	dev->open = niu_open;
-	dev->stop = niu_close;
-	dev->get_stats = niu_get_stats;
-	dev->set_multicast_list = niu_set_rx_mode;
-	dev->set_mac_address = niu_set_mac_addr;
-	dev->do_ioctl = niu_ioctl;
-	dev->tx_timeout = niu_tx_timeout;
+	dev->netdev_ops = &niu_netdev_ops;
 	dev->hard_start_xmit = niu_start_xmit;
 	dev->ethtool_ops = &niu_ethtool_ops;
 	dev->watchdog_timeo = NIU_TX_TIMEOUT;
-	dev->change_mtu = niu_change_mtu;
 }
 
 static void __devinit niu_device_announce(struct niu *np)