Commit 50c7fd6f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge kroah.com:/home/greg/linux/BK/bleed-2.6

into kroah.com:/home/greg/linux/BK/driver-2.6
parents 9e81ab3b 9d6cc8f2
......@@ -169,6 +169,24 @@ struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev,
}
EXPORT_SYMBOL(class_simple_device_add);
/**
* class_simple_set_hotplug - set the hotplug callback in the embedded struct class
* @cs: pointer to the struct class_simple to hold the pointer
* @hotplug: function pointer to the hotplug function
*
* Implement and set a hotplug function to add environment variables specific to this
* class on the hotplug event.
*/
int class_simple_set_hotplug(struct class_simple *cs,
int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size))
{
if ((cs == NULL) || (IS_ERR(cs)))
return -ENODEV;
cs->class.hotplug = hotplug;
return 0;
}
EXPORT_SYMBOL(class_simple_set_hotplug);
/**
* class_simple_device_remove - removes a class device that was created with class_simple_device_add()
* @dev: the dev_t of the device that was previously registered.
......
......@@ -76,7 +76,6 @@ static struct sysfs_ops dev_sysfs_ops = {
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 @@ static void device_release(struct kobject * kobj)
dev->bus_id);
WARN_ON(1);
}
if (c)
complete(c);
}
static struct kobj_type ktype_device = {
......@@ -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.
* @dev: parent struct device.
......@@ -421,7 +399,6 @@ EXPORT_SYMBOL(device_register);
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);
......
......@@ -253,6 +253,8 @@ extern struct class_simple *class_simple_create(struct module *owner, char *name
extern void class_simple_destroy(struct class_simple *cs);
extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...)
__attribute__((format(printf,4,5)));
extern int class_simple_set_hotplug(struct class_simple *,
int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size));
extern void class_simple_device_remove(dev_t dev);
......@@ -263,7 +265,6 @@ struct device {
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 */
......@@ -311,7 +312,6 @@ dev_set_drvdata (struct device *dev, void *data)
*/
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);
......
......@@ -630,6 +630,9 @@ EXPORT_SYMBOL(kobject_register);
EXPORT_SYMBOL(kobject_unregister);
EXPORT_SYMBOL(kobject_get);
EXPORT_SYMBOL(kobject_put);
EXPORT_SYMBOL(kobject_add);
EXPORT_SYMBOL(kobject_del);
EXPORT_SYMBOL(kobject_rename);
EXPORT_SYMBOL(kobject_hotplug);
EXPORT_SYMBOL(kset_register);
......
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