aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:15 -0400
committerJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:59 -0400
commit07f9479a40cc778bc1462ada11f95b01360ae4ff (patch)
tree0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /drivers/base
parent9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff)
parentcd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff)
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be applied for files that didn't exist on the old branch.
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/Kconfig7
-rw-r--r--drivers/base/platform.c7
-rw-r--r--drivers/base/power/main.c8
-rw-r--r--drivers/base/power/runtime.c2
-rw-r--r--drivers/base/sys.c17
-rw-r--r--drivers/base/syscore.c2
6 files changed, 27 insertions, 16 deletions
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index d57e8d0fb823..e9e5238f3106 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -168,4 +168,11 @@ config SYS_HYPERVISOR
168 bool 168 bool
169 default n 169 default n
170 170
171config ARCH_NO_SYSDEV_OPS
172 bool
173 ---help---
174 To be selected by architectures that don't use sysdev class or
175 sysdev driver power management (suspend/resume) and shutdown
176 operations.
177
171endmenu 178endmenu
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index f051cfff18af..9e0e4fc24c46 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -149,6 +149,7 @@ static void platform_device_release(struct device *dev)
149 149
150 of_device_node_put(&pa->pdev.dev); 150 of_device_node_put(&pa->pdev.dev);
151 kfree(pa->pdev.dev.platform_data); 151 kfree(pa->pdev.dev.platform_data);
152 kfree(pa->pdev.mfd_cell);
152 kfree(pa->pdev.resource); 153 kfree(pa->pdev.resource);
153 kfree(pa); 154 kfree(pa);
154} 155}
@@ -771,7 +772,7 @@ int __weak platform_pm_resume_noirq(struct device *dev)
771 772
772#endif /* !CONFIG_SUSPEND */ 773#endif /* !CONFIG_SUSPEND */
773 774
774#ifdef CONFIG_HIBERNATION 775#ifdef CONFIG_HIBERNATE_CALLBACKS
775 776
776static int platform_pm_freeze(struct device *dev) 777static int platform_pm_freeze(struct device *dev)
777{ 778{
@@ -909,7 +910,7 @@ static int platform_pm_restore_noirq(struct device *dev)
909 return ret; 910 return ret;
910} 911}
911 912
912#else /* !CONFIG_HIBERNATION */ 913#else /* !CONFIG_HIBERNATE_CALLBACKS */
913 914
914#define platform_pm_freeze NULL 915#define platform_pm_freeze NULL
915#define platform_pm_thaw NULL 916#define platform_pm_thaw NULL
@@ -920,7 +921,7 @@ static int platform_pm_restore_noirq(struct device *dev)
920#define platform_pm_poweroff_noirq NULL 921#define platform_pm_poweroff_noirq NULL
921#define platform_pm_restore_noirq NULL 922#define platform_pm_restore_noirq NULL
922 923
923#endif /* !CONFIG_HIBERNATION */ 924#endif /* !CONFIG_HIBERNATE_CALLBACKS */
924 925
925#ifdef CONFIG_PM_RUNTIME 926#ifdef CONFIG_PM_RUNTIME
926 927
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 052dc53eef38..fbc5b6e7c591 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -233,7 +233,7 @@ static int pm_op(struct device *dev,
233 } 233 }
234 break; 234 break;
235#endif /* CONFIG_SUSPEND */ 235#endif /* CONFIG_SUSPEND */
236#ifdef CONFIG_HIBERNATION 236#ifdef CONFIG_HIBERNATE_CALLBACKS
237 case PM_EVENT_FREEZE: 237 case PM_EVENT_FREEZE:
238 case PM_EVENT_QUIESCE: 238 case PM_EVENT_QUIESCE:
239 if (ops->freeze) { 239 if (ops->freeze) {
@@ -260,7 +260,7 @@ static int pm_op(struct device *dev,
260 suspend_report_result(ops->restore, error); 260 suspend_report_result(ops->restore, error);
261 } 261 }
262 break; 262 break;
263#endif /* CONFIG_HIBERNATION */ 263#endif /* CONFIG_HIBERNATE_CALLBACKS */
264 default: 264 default:
265 error = -EINVAL; 265 error = -EINVAL;
266 } 266 }
@@ -308,7 +308,7 @@ static int pm_noirq_op(struct device *dev,
308 } 308 }
309 break; 309 break;
310#endif /* CONFIG_SUSPEND */ 310#endif /* CONFIG_SUSPEND */
311#ifdef CONFIG_HIBERNATION 311#ifdef CONFIG_HIBERNATE_CALLBACKS
312 case PM_EVENT_FREEZE: 312 case PM_EVENT_FREEZE:
313 case PM_EVENT_QUIESCE: 313 case PM_EVENT_QUIESCE:
314 if (ops->freeze_noirq) { 314 if (ops->freeze_noirq) {
@@ -335,7 +335,7 @@ static int pm_noirq_op(struct device *dev,
335 suspend_report_result(ops->restore_noirq, error); 335 suspend_report_result(ops->restore_noirq, error);
336 } 336 }
337 break; 337 break;
338#endif /* CONFIG_HIBERNATION */ 338#endif /* CONFIG_HIBERNATE_CALLBACKS */
339 default: 339 default:
340 error = -EINVAL; 340 error = -EINVAL;
341 } 341 }
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 54597c859ecb..3172c60d23a9 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -443,7 +443,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
443 * 443 *
444 * Check if the device's run-time PM status allows it to be resumed. Cancel 444 * Check if the device's run-time PM status allows it to be resumed. Cancel
445 * any scheduled or pending requests. If another resume has been started 445 * any scheduled or pending requests. If another resume has been started
446 * earlier, either return imediately or wait for it to finish, depending on the 446 * earlier, either return immediately or wait for it to finish, depending on the
447 * RPM_NOWAIT and RPM_ASYNC flags. Similarly, if there's a suspend running in 447 * RPM_NOWAIT and RPM_ASYNC flags. Similarly, if there's a suspend running in
448 * parallel with this function, either tell the other process to resume after 448 * parallel with this function, either tell the other process to resume after
449 * suspending (deferred_resume) or wait for it to finish. If the RPM_ASYNC 449 * suspending (deferred_resume) or wait for it to finish. If the RPM_ASYNC
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index f6fb54741602..acde9b5ee131 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -197,7 +197,7 @@ kset_put:
197} 197}
198 198
199/** 199/**
200 * sysdev_driver_register - Register auxillary driver 200 * sysdev_driver_register - Register auxiliary driver
201 * @cls: Device class driver belongs to. 201 * @cls: Device class driver belongs to.
202 * @drv: Driver. 202 * @drv: Driver.
203 * 203 *
@@ -250,7 +250,7 @@ unlock:
250} 250}
251 251
252/** 252/**
253 * sysdev_driver_unregister - Remove an auxillary driver. 253 * sysdev_driver_unregister - Remove an auxiliary driver.
254 * @cls: Class driver belongs to. 254 * @cls: Class driver belongs to.
255 * @drv: Driver. 255 * @drv: Driver.
256 */ 256 */
@@ -302,7 +302,7 @@ int sysdev_register(struct sys_device *sysdev)
302 * code that should have called us. 302 * code that should have called us.
303 */ 303 */
304 304
305 /* Notify class auxillary drivers */ 305 /* Notify class auxiliary drivers */
306 list_for_each_entry(drv, &cls->drivers, entry) { 306 list_for_each_entry(drv, &cls->drivers, entry) {
307 if (drv->add) 307 if (drv->add)
308 drv->add(sysdev); 308 drv->add(sysdev);
@@ -329,13 +329,13 @@ void sysdev_unregister(struct sys_device *sysdev)
329} 329}
330 330
331 331
332 332#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
333/** 333/**
334 * sysdev_shutdown - Shut down all system devices. 334 * sysdev_shutdown - Shut down all system devices.
335 * 335 *
336 * Loop over each class of system devices, and the devices in each 336 * Loop over each class of system devices, and the devices in each
337 * of those classes. For each device, we call the shutdown method for 337 * of those classes. For each device, we call the shutdown method for
338 * each driver registered for the device - the auxillaries, 338 * each driver registered for the device - the auxiliaries,
339 * and the class driver. 339 * and the class driver.
340 * 340 *
341 * Note: The list is iterated in reverse order, so that we shut down 341 * Note: The list is iterated in reverse order, so that we shut down
@@ -360,7 +360,7 @@ void sysdev_shutdown(void)
360 struct sysdev_driver *drv; 360 struct sysdev_driver *drv;
361 pr_debug(" %s\n", kobject_name(&sysdev->kobj)); 361 pr_debug(" %s\n", kobject_name(&sysdev->kobj));
362 362
363 /* Call auxillary drivers first */ 363 /* Call auxiliary drivers first */
364 list_for_each_entry(drv, &cls->drivers, entry) { 364 list_for_each_entry(drv, &cls->drivers, entry) {
365 if (drv->shutdown) 365 if (drv->shutdown)
366 drv->shutdown(sysdev); 366 drv->shutdown(sysdev);
@@ -385,7 +385,7 @@ static void __sysdev_resume(struct sys_device *dev)
385 WARN_ONCE(!irqs_disabled(), 385 WARN_ONCE(!irqs_disabled(),
386 "Interrupts enabled after %pF\n", cls->resume); 386 "Interrupts enabled after %pF\n", cls->resume);
387 387
388 /* Call auxillary drivers next. */ 388 /* Call auxiliary drivers next. */
389 list_for_each_entry(drv, &cls->drivers, entry) { 389 list_for_each_entry(drv, &cls->drivers, entry) {
390 if (drv->resume) 390 if (drv->resume)
391 drv->resume(dev); 391 drv->resume(dev);
@@ -432,7 +432,7 @@ int sysdev_suspend(pm_message_t state)
432 list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) { 432 list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
433 pr_debug(" %s\n", kobject_name(&sysdev->kobj)); 433 pr_debug(" %s\n", kobject_name(&sysdev->kobj));
434 434
435 /* Call auxillary drivers first */ 435 /* Call auxiliary drivers first */
436 list_for_each_entry(drv, &cls->drivers, entry) { 436 list_for_each_entry(drv, &cls->drivers, entry) {
437 if (drv->suspend) { 437 if (drv->suspend) {
438 ret = drv->suspend(sysdev, state); 438 ret = drv->suspend(sysdev, state);
@@ -524,6 +524,7 @@ int sysdev_resume(void)
524 return 0; 524 return 0;
525} 525}
526EXPORT_SYMBOL_GPL(sysdev_resume); 526EXPORT_SYMBOL_GPL(sysdev_resume);
527#endif /* CONFIG_ARCH_NO_SYSDEV_OPS */
527 528
528int __init system_bus_init(void) 529int __init system_bus_init(void)
529{ 530{
diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c
index 90af2943f9e4..c126db3cb7d1 100644
--- a/drivers/base/syscore.c
+++ b/drivers/base/syscore.c
@@ -73,6 +73,7 @@ int syscore_suspend(void)
73 73
74 return ret; 74 return ret;
75} 75}
76EXPORT_SYMBOL_GPL(syscore_suspend);
76 77
77/** 78/**
78 * syscore_resume - Execute all the registered system core resume callbacks. 79 * syscore_resume - Execute all the registered system core resume callbacks.
@@ -95,6 +96,7 @@ void syscore_resume(void)
95 "Interrupts enabled after %pF\n", ops->resume); 96 "Interrupts enabled after %pF\n", ops->resume);
96 } 97 }
97} 98}
99EXPORT_SYMBOL_GPL(syscore_resume);
98#endif /* CONFIG_PM_SLEEP */ 100#endif /* CONFIG_PM_SLEEP */
99 101
100/** 102/**