Commit 9d6cc8f2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

parent a2db4282
...@@ -76,7 +76,6 @@ static struct sysfs_ops dev_sysfs_ops = { ...@@ -76,7 +76,6 @@ static struct sysfs_ops dev_sysfs_ops = {
static void device_release(struct kobject * kobj) static void device_release(struct kobject * kobj)
{ {
struct device * dev = to_dev(kobj); struct device * dev = to_dev(kobj);
struct completion * c = dev->complete;
if (dev->release) if (dev->release)
dev->release(dev); dev->release(dev);
...@@ -86,8 +85,6 @@ static void device_release(struct kobject * kobj) ...@@ -86,8 +85,6 @@ static void device_release(struct kobject * kobj)
dev->bus_id); dev->bus_id);
WARN_ON(1); WARN_ON(1);
} }
if (c)
complete(c);
} }
static struct kobj_type ktype_device = { static struct kobj_type ktype_device = {
...@@ -354,25 +351,6 @@ void device_unregister(struct device * dev) ...@@ -354,25 +351,6 @@ void device_unregister(struct device * dev)
} }
/**
* 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. * device_for_each_child - device child iterator.
* @dev: parent struct device. * @dev: parent struct device.
...@@ -421,7 +399,6 @@ EXPORT_SYMBOL(device_register); ...@@ -421,7 +399,6 @@ EXPORT_SYMBOL(device_register);
EXPORT_SYMBOL(device_del); EXPORT_SYMBOL(device_del);
EXPORT_SYMBOL(device_unregister); EXPORT_SYMBOL(device_unregister);
EXPORT_SYMBOL(device_unregister_wait);
EXPORT_SYMBOL(get_device); EXPORT_SYMBOL(get_device);
EXPORT_SYMBOL(put_device); EXPORT_SYMBOL(put_device);
EXPORT_SYMBOL(device_find); EXPORT_SYMBOL(device_find);
......
...@@ -265,7 +265,6 @@ struct device { ...@@ -265,7 +265,6 @@ struct device {
struct list_head children; struct list_head children;
struct device * parent; struct device * parent;
struct completion * complete; /* Notification for freeing device. */
struct kobject kobj; struct kobject kobj;
char bus_id[BUS_ID_SIZE]; /* position on parent bus */ char bus_id[BUS_ID_SIZE]; /* position on parent bus */
...@@ -313,7 +312,6 @@ dev_set_drvdata (struct device *dev, void *data) ...@@ -313,7 +312,6 @@ dev_set_drvdata (struct device *dev, void *data)
*/ */
extern int device_register(struct device * dev); extern int device_register(struct device * dev);
extern void device_unregister(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 void device_initialize(struct device * dev);
extern int device_add(struct device * dev); extern int device_add(struct device * dev);
extern void device_del(struct device * dev); extern void device_del(struct device * dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment