All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] deprecate dev_get
@ 2003-09-16  0:12 Stephen Hemminger
  2003-09-16  5:42 ` David S. Miller
  2003-09-20  8:10 ` David S. Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Hemminger @ 2003-09-16  0:12 UTC (permalink / raw
  To: David S. Miller, Jeff Garzik; +Cc: netdev

The interface dev_get has past it's usefulness.  I sent out patches
that remove the two other uses left of it in the 2.6 tree.

This marks it as deprecated because there still may be out of tree
drivers that use it.

diff -urN -X dontdiff linux-2.5/include/linux/netdevice.h linux-2.5-net/include/linux/netdevice.h
--- linux-2.5/include/linux/netdevice.h	2003-09-05 09:36:05.000000000 -0700
+++ linux-2.5-net/include/linux/netdevice.h	2003-09-12 12:22:57.000000000 -0700
@@ -502,7 +502,11 @@
 extern void		dev_add_pack(struct packet_type *pt);
 extern void		dev_remove_pack(struct packet_type *pt);
 extern void		__dev_remove_pack(struct packet_type *pt);
-extern int		dev_get(const char *name);
+extern int		__dev_get(const char *name);
+static inline int __deprecated dev_get(const char *name)
+{
+	return __dev_get(name);
+}
 extern struct net_device	*dev_get_by_flags(unsigned short flags,
 						  unsigned short mask);
 extern struct net_device	*__dev_get_by_flags(unsigned short flags,
diff -urN -X dontdiff linux-2.5/net/core/dev.c linux-2.5-net/net/core/dev.c
--- linux-2.5/net/core/dev.c	2003-09-12 11:44:40.000000000 -0700
+++ linux-2.5-net/net/core/dev.c	2003-09-12 12:38:48.000000000 -0700
@@ -470,10 +470,10 @@
  *	to be sure the name is not allocated or removed during the test the
  *	caller must hold the rtnl semaphore.
  *
- *	This function primarily exists for back compatibility with older
+ *	This function exists only for back compatibility with older
  *	drivers.
  */
-int dev_get(const char *name)
+int __dev_get(const char *name)
 {
 	struct net_device *dev;
 
@@ -698,7 +698,13 @@
 
 void dev_load(const char *name)
 {
-	if (!dev_get(name) && capable(CAP_SYS_MODULE))
+	struct net_device *dev;  
+
+	read_lock(&dev_base_lock);
+	dev = __dev_get_by_name(name);
+	read_unlock(&dev_base_lock);
+
+	if (dev && capable(CAP_SYS_MODULE))
 		request_module("%s", name);
 }
 
diff -urN -X dontdiff linux-2.5/net/netsyms.c linux-2.5-net/net/netsyms.c
--- linux-2.5/net/netsyms.c	2003-09-02 08:48:11.000000000 -0700
+++ linux-2.5-net/net/netsyms.c	2003-09-12 17:24:11.000000000 -0700
@@ -511,7 +511,7 @@
 EXPORT_SYMBOL(dev_add_pack);
 EXPORT_SYMBOL(dev_remove_pack);
 EXPORT_SYMBOL(__dev_remove_pack);
-EXPORT_SYMBOL(dev_get);
+EXPORT_SYMBOL(__dev_get);
 EXPORT_SYMBOL(dev_alloc);
 EXPORT_SYMBOL(dev_alloc_name);
 EXPORT_SYMBOL(__netdev_watchdog_up);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] deprecate dev_get
  2003-09-16  0:12 [PATCH] deprecate dev_get Stephen Hemminger
@ 2003-09-16  5:42 ` David S. Miller
  2003-09-16 19:53   ` Jeff Garzik
  2003-09-20  8:10 ` David S. Miller
  1 sibling, 1 reply; 4+ messages in thread
From: David S. Miller @ 2003-09-16  5:42 UTC (permalink / raw
  To: Stephen Hemminger; +Cc: jgarzik, netdev

On Mon, 15 Sep 2003 17:12:30 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> The interface dev_get has past it's usefulness.  I sent out patches
> that remove the two other uses left of it in the 2.6 tree.

I'll put this in after Jeff and others put those dev_get() driver
bits into the tree.

Probably isn't going to happen this week, since Linus is not around.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] deprecate dev_get
  2003-09-16  5:42 ` David S. Miller
@ 2003-09-16 19:53   ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2003-09-16 19:53 UTC (permalink / raw
  To: David S. Miller; +Cc: Stephen Hemminger, netdev

On Mon, Sep 15, 2003 at 10:42:55PM -0700, David S. Miller wrote:
> Probably isn't going to happen this week, since Linus is not around.

Jeff is in San Jose and not really around, either :)

	Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] deprecate dev_get
  2003-09-16  0:12 [PATCH] deprecate dev_get Stephen Hemminger
  2003-09-16  5:42 ` David S. Miller
@ 2003-09-20  8:10 ` David S. Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2003-09-20  8:10 UTC (permalink / raw
  To: Stephen Hemminger; +Cc: jgarzik, netdev

On Mon, 15 Sep 2003 17:12:30 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> The interface dev_get has past it's usefulness.  I sent out patches
> that remove the two other uses left of it in the 2.6 tree.
> 
> This marks it as deprecated because there still may be out of tree
> drivers that use it.

I've applied this, and I'll apply your fix next.

Even though Jeff hasn't pushed your other bits yet, the warnings will
just go away once he gets to that.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-20  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-16  0:12 [PATCH] deprecate dev_get Stephen Hemminger
2003-09-16  5:42 ` David S. Miller
2003-09-16 19:53   ` Jeff Garzik
2003-09-20  8:10 ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.