public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Yang Hongyang <yanghy@cn•fujitsu.com>
To: David Miller <davem@davemloft•net>
Cc: "netdev@vger•kernel.org" <netdev@vger•kernel.org>
Subject: [PATCH]spider_net netdev ops conversion
Date: Fri, 20 Mar 2009 16:50:20 +0800	[thread overview]
Message-ID: <49C358CC.4050101@cn.fujitsu.com> (raw)

spider_net: Convert to net_device_ops.

Signed-off-by: Yang Hongyang <yanghy@cn•fujitsu.com>

---
 drivers/net/spider_net.c |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 88d2c67..1c81185 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -2259,6 +2259,22 @@ spider_net_tx_timeout(struct net_device *netdev)
 	card->spider_stats.tx_timeouts++;
 }
 
+static const struct net_device_ops spider_net_ops = {
+	.ndo_open		= spider_net_open;
+	.ndo_stop		= spider_net_stop;
+	.ndo_start_xmit		= spider_net_xmit;
+	.ndo_set_multicast_list	= spider_net_set_multi;
+	.ndo_set_mac_address	= spider_net_set_mac;
+	.ndo_change_mtu		= spider_net_change_mtu;
+	.ndo_do_ioctl		= spider_net_do_ioctl;
+	.ndo_tx_timeout		= spider_net_tx_timeout;
+	/* HW VLAN */
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	/* poll controller */
+	.ndo_poll_controller	= spider_net_poll_controller;
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+};
+
 /**
  * spider_net_setup_netdev_ops - initialization of net_device operations
  * @netdev: net_device structure
@@ -2268,21 +2284,8 @@ spider_net_tx_timeout(struct net_device *netdev)
 static void
 spider_net_setup_netdev_ops(struct net_device *netdev)
 {
-	netdev->open = &spider_net_open;
-	netdev->stop = &spider_net_stop;
-	netdev->hard_start_xmit = &spider_net_xmit;
-	netdev->set_multicast_list = &spider_net_set_multi;
-	netdev->set_mac_address = &spider_net_set_mac;
-	netdev->change_mtu = &spider_net_change_mtu;
-	netdev->do_ioctl = &spider_net_do_ioctl;
-	/* tx watchdog */
-	netdev->tx_timeout = &spider_net_tx_timeout;
+	netdev->netdev_ops = &spider_net_ops;
 	netdev->watchdog_timeo = SPIDER_NET_WATCHDOG_TIMEOUT;
-	/* HW VLAN */
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	/* poll controller */
-	netdev->poll_controller = &spider_net_poll_controller;
-#endif /* CONFIG_NET_POLL_CONTROLLER */
 	/* ethtool ops */
 	netdev->ethtool_ops = &spider_net_ethtool_ops;
 }
-- 
1.6.0.3


-- 
Regards
Yang Hongyang

             reply	other threads:[~2009-03-20  8:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-20  8:50 Yang Hongyang [this message]
2009-03-21 23:52 ` [PATCH]spider_net netdev ops conversion David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49C358CC.4050101@cn.fujitsu.com \
    --to=yanghy@cn$(echo .)fujitsu.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox