Subject: [PATCH 10/10] CAN: use dev_get_by_index_rcu

From: Stephen Hemminger <[email-masked]>
Date: Tue, 10 Nov 2009 09:54:56 -0800

Use new function to avoid doing read_lock().

Signed-off-by: Stephen Hemminger <[email-masked]>

--- a/net/can/bcm.c	2009-11-10 09:45:16.301376272 -0800
+++ b/net/can/bcm.c	2009-11-10 09:46:30.125005956 -0800
@@ -139,13 +139,13 @@ static char *bcm_proc_getifname(char *re
 	if (!ifindex)
 		return "any";
 
-	read_lock(&dev_base_lock);
-	dev = __dev_get_by_index(&init_net, ifindex);
+	rcu_read_lock();
+	dev = dev_get_by_index_rcu(&init_net, ifindex);
 	if (dev)
 		strcpy(result, dev->name);
 	else
 		strcpy(result, "???");
-	read_unlock(&dev_base_lock);
+	rcu_read_unlock();
 
 	return result;
 }

--