Patchwork [17/77] irda: convert sir device to net_device_ops

login
register
mail settings
Submitter stephen hemminger
Date March 21, 2009, 5:35 a.m.
Message ID <20090321053713.827044480@vyatta.com>
Download mbox | patch
Permalink /patch/24859/
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:44 -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:36 a.m.
On Fri, Mar 20, 2009 at 10:35:44PM -0700, Stephen Hemminger wrote:
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Samuel Ortiz <samuel@sortiz.org>

> 
> 
> --- a/drivers/net/irda/sir_dev.c	2009-03-19 22:52:52.826089334 -0700
> +++ b/drivers/net/irda/sir_dev.c	2009-03-19 23:09:32.268774083 -0700
> @@ -865,6 +865,12 @@ out:
>  	return 0;
>  }
>  
> +static const struct net_device_ops sirdev_ops = {
> +	.ndo_start_xmit	= sirdev_hard_xmit,
> +	.ndo_open	= sirdev_open,
> +	.ndo_stop	= sirdev_close,
> +	.ndo_do_ioctl	= sirdev_ioctl,
> +};
>  /* ----------------------------------------------------------------------------- */
>  
>  struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *name)
> @@ -908,10 +914,7 @@ struct sir_dev * sirdev_get_instance(con
>  	dev->netdev = ndev;
>  
>  	/* Override the network functions we need to use */
> -	ndev->hard_start_xmit = sirdev_hard_xmit;
> -	ndev->open = sirdev_open;
> -	ndev->stop = sirdev_close;
> -	ndev->do_ioctl = sirdev_ioctl;
> +	ndev->netdev_ops = &sirdev_ops;
>  
>  	if (register_netdev(ndev)) {
>  		IRDA_ERROR("%s(), register_netdev() failed!\n", __func__);
> 
> --

Patch

--- a/drivers/net/irda/sir_dev.c	2009-03-19 22:52:52.826089334 -0700
+++ b/drivers/net/irda/sir_dev.c	2009-03-19 23:09:32.268774083 -0700
@@ -865,6 +865,12 @@  out:
 	return 0;
 }
 
+static const struct net_device_ops sirdev_ops = {
+	.ndo_start_xmit	= sirdev_hard_xmit,
+	.ndo_open	= sirdev_open,
+	.ndo_stop	= sirdev_close,
+	.ndo_do_ioctl	= sirdev_ioctl,
+};
 /* ----------------------------------------------------------------------------- */
 
 struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *name)
@@ -908,10 +914,7 @@  struct sir_dev * sirdev_get_instance(con
 	dev->netdev = ndev;
 
 	/* Override the network functions we need to use */
-	ndev->hard_start_xmit = sirdev_hard_xmit;
-	ndev->open = sirdev_open;
-	ndev->stop = sirdev_close;
-	ndev->do_ioctl = sirdev_ioctl;
+	ndev->netdev_ops = &sirdev_ops;
 
 	if (register_netdev(ndev)) {
 		IRDA_ERROR("%s(), register_netdev() failed!\n", __func__);