All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core update for 2.6.3-rc1
Date: Mon, 9 Feb 2004 15:25:41 -0800	[thread overview]
Message-ID: <10763691411179@kroah.com> (raw)
In-Reply-To: <10763691411688@kroah.com>

ChangeSet 1.1500.19.3, 2004/02/04 13:48:53-08:00, greg@kroah.com

[PATCH] Driver core: remove device_unregister_wait() as it's a very bad idea.


 drivers/base/core.c    |   23 -----------------------
 include/linux/device.h |    2 --
 2 files changed, 25 deletions(-)


diff -Nru a/drivers/base/core.c b/drivers/base/core.c
--- a/drivers/base/core.c	Mon Feb  9 15:09:04 2004
+++ b/drivers/base/core.c	Mon Feb  9 15:09:04 2004
@@ -76,7 +76,6 @@
 static void device_release(struct kobject * kobj)
 {
 	struct device * dev = to_dev(kobj);
-	struct completion * c = dev->complete;
 
 	if (dev->release)
 		dev->release(dev);
@@ -86,8 +85,6 @@
 			dev->bus_id);
 		WARN_ON(1);
 	}
-	if (c)
-		complete(c);
 }
 
 static struct kobj_type ktype_device = {
@@ -355,25 +352,6 @@
 
 
 /**
- *	device_unregister_wait - Unregister device and wait for it to be freed.
- *	@dev: Device to unregister.
- *
- *	For the cases where the caller needs to wait for all references to
- *	be dropped from the device before continuing (e.g. modules with
- *	statically allocated devices), this function uses a completion struct
- *	to wait, along with a matching complete() in device_release() above.
- */
-
-void device_unregister_wait(struct device * dev)
-{
-	struct completion c;
-	init_completion(&c);
-	dev->complete = &c;
-	device_unregister(dev);
-	wait_for_completion(&c);
-}
-
-/**
  *	device_for_each_child - device child iterator.
  *	@dev:	parent struct device.
  *	@data:	data for the callback.
@@ -421,7 +399,6 @@
 
 EXPORT_SYMBOL(device_del);
 EXPORT_SYMBOL(device_unregister);
-EXPORT_SYMBOL(device_unregister_wait);
 EXPORT_SYMBOL(get_device);
 EXPORT_SYMBOL(put_device);
 EXPORT_SYMBOL(device_find);
diff -Nru a/include/linux/device.h b/include/linux/device.h
--- a/include/linux/device.h	Mon Feb  9 15:09:04 2004
+++ b/include/linux/device.h	Mon Feb  9 15:09:04 2004
@@ -265,7 +265,6 @@
 	struct list_head children;
 	struct device 	* parent;
 
-	struct completion * complete;	/* Notification for freeing device. */
 	struct kobject kobj;
 	char	bus_id[BUS_ID_SIZE];	/* position on parent bus */
 
@@ -313,7 +312,6 @@
  */
 extern int device_register(struct device * dev);
 extern void device_unregister(struct device * dev);
-extern void device_unregister_wait(struct device * dev);
 extern void device_initialize(struct device * dev);
 extern int device_add(struct device * dev);
 extern void device_del(struct device * dev);


  reply	other threads:[~2004-02-09 23:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-09 23:13 [BK PATCH] Driver Core update for 2.6.3-rc1 Greg KH
2004-02-09 23:25 ` [PATCH] " Greg KH
2004-02-09 23:25   ` Greg KH
2004-02-09 23:25     ` Greg KH
2004-02-09 23:25       ` Greg KH [this message]
2004-02-09 23:25         ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10763691411179@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.