diff mbox

[08/77] irda: convert irda_usb to net_device_ops

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

Commit Message

stephen hemminger March 21, 2009, 5:35 a.m. UTC
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 drivers/net/irda/irda-usb.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Comments

David Miller March 22, 2009, 2:34 a.m. UTC | #1
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 20 Mar 2009 22:35:35 -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:34 a.m. UTC | #2
On Fri, Mar 20, 2009 at 10:35:35PM -0700, Stephen Hemminger wrote:
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Samuel Ortiz <samuel@sortiz.org>

> 
> 
> ---
>  drivers/net/irda/irda-usb.c |   18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> --- a/drivers/net/irda/irda-usb.c	2009-03-19 22:40:30.429651929 -0700
> +++ b/drivers/net/irda/irda-usb.c	2009-03-19 22:42:46.433089198 -0700
> @@ -1401,6 +1401,14 @@ static inline void irda_usb_init_qos(str
>  }
>  
>  /*------------------------------------------------------------------*/
> +static const struct net_device_ops irda_usb_netdev_ops = {
> +	.ndo_open       = irda_usb_net_open,
> +	.ndo_stop       = irda_usb_net_close,
> +	.ndo_do_ioctl   = irda_usb_net_ioctl,
> +	.ndo_start_xmit = irda_usb_hard_xmit,
> +	.ndo_tx_timeout	= irda_usb_net_timeout,
> +};
> +
>  /*
>   * Initialise the network side of the irda-usb instance
>   * Called when a new USB instance is registered in irda_usb_probe()
> @@ -1411,15 +1419,9 @@ static inline int irda_usb_open(struct i
>  
>  	IRDA_DEBUG(1, "%s()\n", __func__);
>  
> -	irda_usb_init_qos(self);
> +	netdev->netdev_ops = &irda_usb_netdev_ops;
>  
> -	/* Override the network functions we need to use */
> -	netdev->hard_start_xmit = irda_usb_hard_xmit;
> -	netdev->tx_timeout	= irda_usb_net_timeout;
> -	netdev->watchdog_timeo  = 250*HZ/1000;	/* 250 ms > USB timeout */
> -	netdev->open            = irda_usb_net_open;
> -	netdev->stop            = irda_usb_net_close;
> -	netdev->do_ioctl        = irda_usb_net_ioctl;
> +	irda_usb_init_qos(self);
>  
>  	return register_netdev(netdev);
>  }
> 
> --
diff mbox

Patch

--- a/drivers/net/irda/irda-usb.c	2009-03-19 22:40:30.429651929 -0700
+++ b/drivers/net/irda/irda-usb.c	2009-03-19 22:42:46.433089198 -0700
@@ -1401,6 +1401,14 @@  static inline void irda_usb_init_qos(str
 }
 
 /*------------------------------------------------------------------*/
+static const struct net_device_ops irda_usb_netdev_ops = {
+	.ndo_open       = irda_usb_net_open,
+	.ndo_stop       = irda_usb_net_close,
+	.ndo_do_ioctl   = irda_usb_net_ioctl,
+	.ndo_start_xmit = irda_usb_hard_xmit,
+	.ndo_tx_timeout	= irda_usb_net_timeout,
+};
+
 /*
  * Initialise the network side of the irda-usb instance
  * Called when a new USB instance is registered in irda_usb_probe()
@@ -1411,15 +1419,9 @@  static inline int irda_usb_open(struct i
 
 	IRDA_DEBUG(1, "%s()\n", __func__);
 
-	irda_usb_init_qos(self);
+	netdev->netdev_ops = &irda_usb_netdev_ops;
 
-	/* Override the network functions we need to use */
-	netdev->hard_start_xmit = irda_usb_hard_xmit;
-	netdev->tx_timeout	= irda_usb_net_timeout;
-	netdev->watchdog_timeo  = 250*HZ/1000;	/* 250 ms > USB timeout */
-	netdev->open            = irda_usb_net_open;
-	netdev->stop            = irda_usb_net_close;
-	netdev->do_ioctl        = irda_usb_net_ioctl;
+	irda_usb_init_qos(self);
 
 	return register_netdev(netdev);
 }