diff mbox

[32/77] usbnet: convert rndis driver to use dev_get_stats

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

Commit Message

stephen hemminger March 21, 2009, 5:35 a.m. UTC
dev_get_stats() handles all issues with net_device_ops

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

---
 drivers/usb/gadget/rndis.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

David Brownell March 21, 2009, 9:22 a.m. UTC | #1
On Friday 20 March 2009, Stephen Hemminger wrote:
> dev_get_stats() handles all issues with net_device_ops
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Acked-by: David Brownell <dbrownell@users.sourceforge.net>


> ---
>  drivers/usb/gadget/rndis.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> --- a/drivers/usb/gadget/rndis.c	2009-03-20 12:18:22.054027493 -0700
> +++ b/drivers/usb/gadget/rndis.c	2009-03-20 12:18:28.620714647 -0700
> @@ -170,7 +170,7 @@ gen_ndis_query_resp (int configNr, u32 O
>  	int			i, count;
>  	rndis_query_cmplt_type	*resp;
>  	struct net_device	*net;
> -	struct net_device_stats	*stats;
> +	const struct net_device_stats	*stats;
>  
>  	if (!r) return -ENOMEM;
>  	resp = (rndis_query_cmplt_type *) r->buf;
> @@ -193,10 +193,7 @@ gen_ndis_query_resp (int configNr, u32 O
>  	resp->InformationBufferOffset = cpu_to_le32 (16);
>  
>  	net = rndis_per_dev_params[configNr].dev;
> -	if (net->get_stats)
> -		stats = net->get_stats(net);
> -	else
> -		stats = NULL;
> +	stats = dev_get_stats(net);
>  
>  	switch (OID) {
>  
> 
> -- 
> 
> 


--
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
David Miller March 22, 2009, 3:01 a.m. UTC | #2
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 20 Mar 2009 22:35:59 -0700

> dev_get_stats() handles all issues with net_device_ops
> 
> 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
diff mbox

Patch

--- a/drivers/usb/gadget/rndis.c	2009-03-20 12:18:22.054027493 -0700
+++ b/drivers/usb/gadget/rndis.c	2009-03-20 12:18:28.620714647 -0700
@@ -170,7 +170,7 @@  gen_ndis_query_resp (int configNr, u32 O
 	int			i, count;
 	rndis_query_cmplt_type	*resp;
 	struct net_device	*net;
-	struct net_device_stats	*stats;
+	const struct net_device_stats	*stats;
 
 	if (!r) return -ENOMEM;
 	resp = (rndis_query_cmplt_type *) r->buf;
@@ -193,10 +193,7 @@  gen_ndis_query_resp (int configNr, u32 O
 	resp->InformationBufferOffset = cpu_to_le32 (16);
 
 	net = rndis_per_dev_params[configNr].dev;
-	if (net->get_stats)
-		stats = net->get_stats(net);
-	else
-		stats = NULL;
+	stats = dev_get_stats(net);
 
 	switch (OID) {