Patchwork [14/26] mace: convert to net_device_ops

login
register
mail settings
Submitter Alexander Beregalov
Date April 15, 2009, 10:52 p.m.
Message ID <1239835980-22502-14-git-send-email-a.beregalov@gmail.com>
Download mbox | patch
Permalink /patch/26028/
State Accepted
Delegated to: David Miller
Headers show

Comments

Alexander Beregalov - April 15, 2009, 10:52 p.m.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 drivers/net/mace.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

Patch

diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index feebbd9..1ad740b 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -94,6 +94,16 @@  static void __mace_set_address(struct net_device *dev, void *addr);
  */
 static unsigned char *dummy_buf;
 
+static const struct net_device_ops mace_netdev_ops = {
+	.ndo_open		= mace_open,
+	.ndo_stop		= mace_close,
+	.ndo_start_xmit		= mace_xmit_start,
+	.ndo_set_multicast_list	= mace_set_multicast,
+	.ndo_set_mac_address	= mace_set_address,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_validate_addr	= eth_validate_addr,
+};
+
 static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
 {
 	struct device_node *mace = macio_get_of_node(mdev);
@@ -207,11 +217,7 @@  static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
 		}
 	}
 
-	dev->open = mace_open;
-	dev->stop = mace_close;
-	dev->hard_start_xmit = mace_xmit_start;
-	dev->set_multicast_list = mace_set_multicast;
-	dev->set_mac_address = mace_set_address;
+	dev->netdev_ops = &mace_netdev_ops;
 
 	/*
 	 * Most of what is below could be moved to mace_open()