diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/core.c | 33 | ||||
-rw-r--r-- | drivers/base/dd.c | 4 | ||||
-rw-r--r-- | drivers/base/topology.c | 3 |
3 files changed, 3 insertions, 37 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 0dd65281cc65..20da3ad1696b 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -614,39 +614,6 @@ void device_remove_bin_file(struct device *dev, | |||
614 | } | 614 | } |
615 | EXPORT_SYMBOL_GPL(device_remove_bin_file); | 615 | EXPORT_SYMBOL_GPL(device_remove_bin_file); |
616 | 616 | ||
617 | /** | ||
618 | * device_schedule_callback_owner - helper to schedule a callback for a device | ||
619 | * @dev: device. | ||
620 | * @func: callback function to invoke later. | ||
621 | * @owner: module owning the callback routine | ||
622 | * | ||
623 | * Attribute methods must not unregister themselves or their parent device | ||
624 | * (which would amount to the same thing). Attempts to do so will deadlock, | ||
625 | * since unregistration is mutually exclusive with driver callbacks. | ||
626 | * | ||
627 | * Instead methods can call this routine, which will attempt to allocate | ||
628 | * and schedule a workqueue request to call back @func with @dev as its | ||
629 | * argument in the workqueue's process context. @dev will be pinned until | ||
630 | * @func returns. | ||
631 | * | ||
632 | * This routine is usually called via the inline device_schedule_callback(), | ||
633 | * which automatically sets @owner to THIS_MODULE. | ||
634 | * | ||
635 | * Returns 0 if the request was submitted, -ENOMEM if storage could not | ||
636 | * be allocated, -ENODEV if a reference to @owner isn't available. | ||
637 | * | ||
638 | * NOTE: This routine won't work if CONFIG_SYSFS isn't set! It uses an | ||
639 | * underlying sysfs routine (since it is intended for use by attribute | ||
640 | * methods), and if sysfs isn't available you'll get nothing but -ENOSYS. | ||
641 | */ | ||
642 | int device_schedule_callback_owner(struct device *dev, | ||
643 | void (*func)(struct device *), struct module *owner) | ||
644 | { | ||
645 | return sysfs_schedule_callback(&dev->kobj, | ||
646 | (void (*)(void *)) func, dev, owner); | ||
647 | } | ||
648 | EXPORT_SYMBOL_GPL(device_schedule_callback_owner); | ||
649 | |||
650 | static void klist_children_get(struct klist_node *n) | 617 | static void klist_children_get(struct klist_node *n) |
651 | { | 618 | { |
652 | struct device_private *p = to_device_private_parent(n); | 619 | struct device_private *p = to_device_private_parent(n); |
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 06051767393f..8986b9f22781 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -187,8 +187,8 @@ static void driver_bound(struct device *dev) | |||
187 | return; | 187 | return; |
188 | } | 188 | } |
189 | 189 | ||
190 | pr_debug("driver: '%s': %s: bound to device '%s'\n", dev_name(dev), | 190 | pr_debug("driver: '%s': %s: bound to device '%s'\n", dev->driver->name, |
191 | __func__, dev->driver->name); | 191 | __func__, dev_name(dev)); |
192 | 192 | ||
193 | klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); | 193 | klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); |
194 | 194 | ||
diff --git a/drivers/base/topology.c b/drivers/base/topology.c index bbcbd3c43926..be7c1fb7c0c9 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c | |||
@@ -39,8 +39,7 @@ | |||
39 | static ssize_t show_##name(struct device *dev, \ | 39 | static ssize_t show_##name(struct device *dev, \ |
40 | struct device_attribute *attr, char *buf) \ | 40 | struct device_attribute *attr, char *buf) \ |
41 | { \ | 41 | { \ |
42 | unsigned int cpu = dev->id; \ | 42 | return sprintf(buf, "%d\n", topology_##name(dev->id)); \ |
43 | return sprintf(buf, "%d\n", topology_##name(cpu)); \ | ||
44 | } | 43 | } |
45 | 44 | ||
46 | #if defined(topology_thread_cpumask) || defined(topology_core_cpumask) || \ | 45 | #if defined(topology_thread_cpumask) || defined(topology_core_cpumask) || \ |