Patchwork [11/77] irda: convert w83977af_ir to net_device_ops

login
register
mail settings
Submitter stephen hemminger
Date March 21, 2009, 5:35 a.m.
Message ID <20090321053713.376037045@vyatta.com>
Download mbox | patch
Permalink /patch/24857/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - March 21, 2009, 5:35 a.m.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
David Miller - March 22, 2009, 2:36 a.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 20 Mar 2009 22:35:38 -0700

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

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
Samuel Ortiz - March 23, 2009, 11:35 a.m.
On Fri, Mar 20, 2009 at 10:35:38PM -0700, Stephen Hemminger wrote:
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Samuel Ortiz <samuel@sortiz.org>

> 
> --- a/drivers/net/irda/w83977af_ir.c	2009-03-19 22:40:30.367964328 -0700
> +++ b/drivers/net/irda/w83977af_ir.c	2009-03-19 22:42:48.582901908 -0700
> @@ -140,6 +140,13 @@ static void __exit w83977af_cleanup(void
>  	}
>  }
>  
> +static const struct net_device_ops w83977_netdev_ops = {
> +	.ndo_open       = w83977af_net_open,
> +	.ndo_stop       = w83977af_net_close,
> +	.ndo_start_xmit = w83977af_hard_xmit,
> +	.ndo_do_ioctl   = w83977af_net_ioctl,
> +};
> +
>  /*
>   * Function w83977af_open (iobase, irq)
>   *
> @@ -231,11 +238,7 @@ static int w83977af_open(int i, unsigned
>  	self->rx_buff.data = self->rx_buff.head;
>  	self->netdev = dev;
>  
> -	/* Override the network functions we need to use */
> -	dev->hard_start_xmit = w83977af_hard_xmit;
> -	dev->open            = w83977af_net_open;
> -	dev->stop            = w83977af_net_close;
> -	dev->do_ioctl        = w83977af_net_ioctl;
> +	dev->netdev_ops	= &w83977_netdev_ops;
>  
>  	err = register_netdev(dev);
>  	if (err) {
> 
> --

Patch

--- a/drivers/net/irda/w83977af_ir.c	2009-03-19 22:40:30.367964328 -0700
+++ b/drivers/net/irda/w83977af_ir.c	2009-03-19 22:42:48.582901908 -0700
@@ -140,6 +140,13 @@  static void __exit w83977af_cleanup(void
 	}
 }
 
+static const struct net_device_ops w83977_netdev_ops = {
+	.ndo_open       = w83977af_net_open,
+	.ndo_stop       = w83977af_net_close,
+	.ndo_start_xmit = w83977af_hard_xmit,
+	.ndo_do_ioctl   = w83977af_net_ioctl,
+};
+
 /*
  * Function w83977af_open (iobase, irq)
  *
@@ -231,11 +238,7 @@  static int w83977af_open(int i, unsigned
 	self->rx_buff.data = self->rx_buff.head;
 	self->netdev = dev;
 
-	/* Override the network functions we need to use */
-	dev->hard_start_xmit = w83977af_hard_xmit;
-	dev->open            = w83977af_net_open;
-	dev->stop            = w83977af_net_close;
-	dev->do_ioctl        = w83977af_net_ioctl;
+	dev->netdev_ops	= &w83977_netdev_ops;
 
 	err = register_netdev(dev);
 	if (err) {