diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/bus.c | 17 | ||||
-rw-r--r-- | drivers/base/driver.c | 2 | ||||
-rw-r--r-- | drivers/base/platform.c | 6 | ||||
-rw-r--r-- | drivers/base/power/main.c | 1 | ||||
-rw-r--r-- | drivers/base/power/runtime.c | 16 |
5 files changed, 24 insertions, 18 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 973bf2ad4e0d..63c143e54a57 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -689,15 +689,19 @@ int bus_add_driver(struct device_driver *drv) | |||
689 | printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n", | 689 | printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n", |
690 | __func__, drv->name); | 690 | __func__, drv->name); |
691 | } | 691 | } |
692 | error = add_bind_files(drv); | 692 | |
693 | if (error) { | 693 | if (!drv->suppress_bind_attrs) { |
694 | /* Ditto */ | 694 | error = add_bind_files(drv); |
695 | printk(KERN_ERR "%s: add_bind_files(%s) failed\n", | 695 | if (error) { |
696 | __func__, drv->name); | 696 | /* Ditto */ |
697 | printk(KERN_ERR "%s: add_bind_files(%s) failed\n", | ||
698 | __func__, drv->name); | ||
699 | } | ||
697 | } | 700 | } |
698 | 701 | ||
699 | kobject_uevent(&priv->kobj, KOBJ_ADD); | 702 | kobject_uevent(&priv->kobj, KOBJ_ADD); |
700 | return 0; | 703 | return 0; |
704 | |||
701 | out_unregister: | 705 | out_unregister: |
702 | kfree(drv->p); | 706 | kfree(drv->p); |
703 | drv->p = NULL; | 707 | drv->p = NULL; |
@@ -720,7 +724,8 @@ void bus_remove_driver(struct device_driver *drv) | |||
720 | if (!drv->bus) | 724 | if (!drv->bus) |
721 | return; | 725 | return; |
722 | 726 | ||
723 | remove_bind_files(drv); | 727 | if (!drv->suppress_bind_attrs) |
728 | remove_bind_files(drv); | ||
724 | driver_remove_attrs(drv->bus, drv); | 729 | driver_remove_attrs(drv->bus, drv); |
725 | driver_remove_file(drv, &driver_attr_uevent); | 730 | driver_remove_file(drv, &driver_attr_uevent); |
726 | klist_remove(&drv->p->knode_bus); | 731 | klist_remove(&drv->p->knode_bus); |
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index ed2ebd3c287d..f367885a7646 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c | |||
@@ -236,7 +236,7 @@ int driver_register(struct device_driver *drv) | |||
236 | put_driver(other); | 236 | put_driver(other); |
237 | printk(KERN_ERR "Error: Driver '%s' is already registered, " | 237 | printk(KERN_ERR "Error: Driver '%s' is already registered, " |
238 | "aborting...\n", drv->name); | 238 | "aborting...\n", drv->name); |
239 | return -EEXIST; | 239 | return -EBUSY; |
240 | } | 240 | } |
241 | 241 | ||
242 | ret = bus_add_driver(drv); | 242 | ret = bus_add_driver(drv); |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ed156a13aa40..4fa954b07ac4 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -521,11 +521,15 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv, | |||
521 | { | 521 | { |
522 | int retval, code; | 522 | int retval, code; |
523 | 523 | ||
524 | /* make sure driver won't have bind/unbind attributes */ | ||
525 | drv->driver.suppress_bind_attrs = true; | ||
526 | |||
524 | /* temporary section violation during probe() */ | 527 | /* temporary section violation during probe() */ |
525 | drv->probe = probe; | 528 | drv->probe = probe; |
526 | retval = code = platform_driver_register(drv); | 529 | retval = code = platform_driver_register(drv); |
527 | 530 | ||
528 | /* Fixup that section violation, being paranoid about code scanning | 531 | /* |
532 | * Fixup that section violation, being paranoid about code scanning | ||
529 | * the list of drivers in order to probe new devices. Check to see | 533 | * the list of drivers in order to probe new devices. Check to see |
530 | * if the probe was successful, and make sure any forced probes of | 534 | * if the probe was successful, and make sure any forced probes of |
531 | * new devices fail. | 535 | * new devices fail. |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index e0dc4071e088..8aa2443182d5 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -511,6 +511,7 @@ static void dpm_complete(pm_message_t state) | |||
511 | 511 | ||
512 | INIT_LIST_HEAD(&list); | 512 | INIT_LIST_HEAD(&list); |
513 | mutex_lock(&dpm_list_mtx); | 513 | mutex_lock(&dpm_list_mtx); |
514 | transition_started = false; | ||
514 | while (!list_empty(&dpm_list)) { | 515 | while (!list_empty(&dpm_list)) { |
515 | struct device *dev = to_device(dpm_list.prev); | 516 | struct device *dev = to_device(dpm_list.prev); |
516 | 517 | ||
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 38556f6cc22d..846d89e3d122 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c | |||
@@ -51,8 +51,6 @@ static int __pm_runtime_idle(struct device *dev) | |||
51 | { | 51 | { |
52 | int retval = 0; | 52 | int retval = 0; |
53 | 53 | ||
54 | dev_dbg(dev, "__pm_runtime_idle()!\n"); | ||
55 | |||
56 | if (dev->power.runtime_error) | 54 | if (dev->power.runtime_error) |
57 | retval = -EINVAL; | 55 | retval = -EINVAL; |
58 | else if (dev->power.idle_notification) | 56 | else if (dev->power.idle_notification) |
@@ -93,8 +91,6 @@ static int __pm_runtime_idle(struct device *dev) | |||
93 | wake_up_all(&dev->power.wait_queue); | 91 | wake_up_all(&dev->power.wait_queue); |
94 | 92 | ||
95 | out: | 93 | out: |
96 | dev_dbg(dev, "__pm_runtime_idle() returns %d!\n", retval); | ||
97 | |||
98 | return retval; | 94 | return retval; |
99 | } | 95 | } |
100 | 96 | ||
@@ -332,11 +328,11 @@ int __pm_runtime_resume(struct device *dev, bool from_wq) | |||
332 | * necessary. | 328 | * necessary. |
333 | */ | 329 | */ |
334 | parent = dev->parent; | 330 | parent = dev->parent; |
335 | spin_unlock_irq(&dev->power.lock); | 331 | spin_unlock(&dev->power.lock); |
336 | 332 | ||
337 | pm_runtime_get_noresume(parent); | 333 | pm_runtime_get_noresume(parent); |
338 | 334 | ||
339 | spin_lock_irq(&parent->power.lock); | 335 | spin_lock(&parent->power.lock); |
340 | /* | 336 | /* |
341 | * We can resume if the parent's run-time PM is disabled or it | 337 | * We can resume if the parent's run-time PM is disabled or it |
342 | * is set to ignore children. | 338 | * is set to ignore children. |
@@ -347,9 +343,9 @@ int __pm_runtime_resume(struct device *dev, bool from_wq) | |||
347 | if (parent->power.runtime_status != RPM_ACTIVE) | 343 | if (parent->power.runtime_status != RPM_ACTIVE) |
348 | retval = -EBUSY; | 344 | retval = -EBUSY; |
349 | } | 345 | } |
350 | spin_unlock_irq(&parent->power.lock); | 346 | spin_unlock(&parent->power.lock); |
351 | 347 | ||
352 | spin_lock_irq(&dev->power.lock); | 348 | spin_lock(&dev->power.lock); |
353 | if (retval) | 349 | if (retval) |
354 | goto out; | 350 | goto out; |
355 | goto repeat; | 351 | goto repeat; |
@@ -781,7 +777,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status) | |||
781 | } | 777 | } |
782 | 778 | ||
783 | if (parent) { | 779 | if (parent) { |
784 | spin_lock_irq(&parent->power.lock); | 780 | spin_lock(&parent->power.lock); |
785 | 781 | ||
786 | /* | 782 | /* |
787 | * It is invalid to put an active child under a parent that is | 783 | * It is invalid to put an active child under a parent that is |
@@ -797,7 +793,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status) | |||
797 | atomic_inc(&parent->power.child_count); | 793 | atomic_inc(&parent->power.child_count); |
798 | } | 794 | } |
799 | 795 | ||
800 | spin_unlock_irq(&parent->power.lock); | 796 | spin_unlock(&parent->power.lock); |
801 | 797 | ||
802 | if (error) | 798 | if (error) |
803 | goto out; | 799 | goto out; |