aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/Kconfig1
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/kernel/apm_32.c4
-rw-r--r--drivers/base/Kconfig7
-rw-r--r--drivers/base/base.h2
-rw-r--r--drivers/base/sys.c202
-rw-r--r--drivers/xen/manage.c8
-rw-r--r--include/linux/device.h7
-rw-r--r--include/linux/pm.h8
-rw-r--r--include/linux/sysdev.h11
-rw-r--r--kernel/kexec.c9
-rw-r--r--kernel/power/hibernate.c18
-rw-r--r--kernel/power/suspend.c8
-rw-r--r--kernel/sys.c3
14 files changed, 7 insertions, 282 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 4b89da248d17..bc439de48cd1 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -24,7 +24,6 @@ config SUPERH
24 select RTC_LIB 24 select RTC_LIB
25 select GENERIC_ATOMIC64 25 select GENERIC_ATOMIC64
26 select GENERIC_IRQ_SHOW 26 select GENERIC_IRQ_SHOW
27 select ARCH_NO_SYSDEV_OPS
28 help 27 help
29 The SuperH is a RISC processor targeted for use in embedded systems 28 The SuperH is a RISC processor targeted for use in embedded systems
30 and consumer electronics; it was also used in the Sega Dreamcast 29 and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cc6c53a95bfd..140e254fe546 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -71,7 +71,6 @@ config X86
71 select GENERIC_IRQ_SHOW 71 select GENERIC_IRQ_SHOW
72 select IRQ_FORCED_THREADING 72 select IRQ_FORCED_THREADING
73 select USE_GENERIC_SMP_HELPERS if SMP 73 select USE_GENERIC_SMP_HELPERS if SMP
74 select ARCH_NO_SYSDEV_OPS
75 74
76config INSTRUCTION_DECODER 75config INSTRUCTION_DECODER
77 def_bool (KPROBES || PERF_EVENTS) 76 def_bool (KPROBES || PERF_EVENTS)
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index adee12e0da1f..3bfa02235965 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1238,7 +1238,6 @@ static int suspend(int vetoable)
1238 dpm_suspend_noirq(PMSG_SUSPEND); 1238 dpm_suspend_noirq(PMSG_SUSPEND);
1239 1239
1240 local_irq_disable(); 1240 local_irq_disable();
1241 sysdev_suspend(PMSG_SUSPEND);
1242 syscore_suspend(); 1241 syscore_suspend();
1243 1242
1244 local_irq_enable(); 1243 local_irq_enable();
@@ -1258,7 +1257,6 @@ static int suspend(int vetoable)
1258 err = (err == APM_SUCCESS) ? 0 : -EIO; 1257 err = (err == APM_SUCCESS) ? 0 : -EIO;
1259 1258
1260 syscore_resume(); 1259 syscore_resume();
1261 sysdev_resume();
1262 local_irq_enable(); 1260 local_irq_enable();
1263 1261
1264 dpm_resume_noirq(PMSG_RESUME); 1262 dpm_resume_noirq(PMSG_RESUME);
@@ -1282,7 +1280,6 @@ static void standby(void)
1282 dpm_suspend_noirq(PMSG_SUSPEND); 1280 dpm_suspend_noirq(PMSG_SUSPEND);
1283 1281
1284 local_irq_disable(); 1282 local_irq_disable();
1285 sysdev_suspend(PMSG_SUSPEND);
1286 syscore_suspend(); 1283 syscore_suspend();
1287 local_irq_enable(); 1284 local_irq_enable();
1288 1285
@@ -1292,7 +1289,6 @@ static void standby(void)
1292 1289
1293 local_irq_disable(); 1290 local_irq_disable();
1294 syscore_resume(); 1291 syscore_resume();
1295 sysdev_resume();
1296 local_irq_enable(); 1292 local_irq_enable();
1297 1293
1298 dpm_resume_noirq(PMSG_RESUME); 1294 dpm_resume_noirq(PMSG_RESUME);
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index e9e5238f3106..d57e8d0fb823 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -168,11 +168,4 @@ 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
178endmenu 171endmenu
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 19f49e41ce5d..a34dca0ad041 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -111,8 +111,6 @@ static inline int driver_match_device(struct device_driver *drv,
111 return drv->bus->match ? drv->bus->match(dev, drv) : 1; 111 return drv->bus->match ? drv->bus->match(dev, drv) : 1;
112} 112}
113 113
114extern void sysdev_shutdown(void);
115
116extern char *make_class_name(const char *name, struct kobject *kobj); 114extern char *make_class_name(const char *name, struct kobject *kobj);
117 115
118extern int devres_release_all(struct device *dev); 116extern int devres_release_all(struct device *dev);
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index acde9b5ee131..9dff77bfe1e3 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -328,203 +328,8 @@ void sysdev_unregister(struct sys_device *sysdev)
328 kobject_put(&sysdev->kobj); 328 kobject_put(&sysdev->kobj);
329} 329}
330 330
331 331EXPORT_SYMBOL_GPL(sysdev_register);
332#ifndef CONFIG_ARCH_NO_SYSDEV_OPS 332EXPORT_SYMBOL_GPL(sysdev_unregister);
333/**
334 * sysdev_shutdown - Shut down all system devices.
335 *
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
338 * each driver registered for the device - the auxiliaries,
339 * and the class driver.
340 *
341 * Note: The list is iterated in reverse order, so that we shut down
342 * child devices before we shut down their parents. The list ordering
343 * is guaranteed by virtue of the fact that child devices are registered
344 * after their parents.
345 */
346void sysdev_shutdown(void)
347{
348 struct sysdev_class *cls;
349
350 pr_debug("Shutting Down System Devices\n");
351
352 mutex_lock(&sysdev_drivers_lock);
353 list_for_each_entry_reverse(cls, &system_kset->list, kset.kobj.entry) {
354 struct sys_device *sysdev;
355
356 pr_debug("Shutting down type '%s':\n",
357 kobject_name(&cls->kset.kobj));
358
359 list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
360 struct sysdev_driver *drv;
361 pr_debug(" %s\n", kobject_name(&sysdev->kobj));
362
363 /* Call auxiliary drivers first */
364 list_for_each_entry(drv, &cls->drivers, entry) {
365 if (drv->shutdown)
366 drv->shutdown(sysdev);
367 }
368
369 /* Now call the generic one */
370 if (cls->shutdown)
371 cls->shutdown(sysdev);
372 }
373 }
374 mutex_unlock(&sysdev_drivers_lock);
375}
376
377static void __sysdev_resume(struct sys_device *dev)
378{
379 struct sysdev_class *cls = dev->cls;
380 struct sysdev_driver *drv;
381
382 /* First, call the class-specific one */
383 if (cls->resume)
384 cls->resume(dev);
385 WARN_ONCE(!irqs_disabled(),
386 "Interrupts enabled after %pF\n", cls->resume);
387
388 /* Call auxiliary drivers next. */
389 list_for_each_entry(drv, &cls->drivers, entry) {
390 if (drv->resume)
391 drv->resume(dev);
392 WARN_ONCE(!irqs_disabled(),
393 "Interrupts enabled after %pF\n", drv->resume);
394 }
395}
396
397/**
398 * sysdev_suspend - Suspend all system devices.
399 * @state: Power state to enter.
400 *
401 * We perform an almost identical operation as sysdev_shutdown()
402 * above, though calling ->suspend() instead. Interrupts are disabled
403 * when this called. Devices are responsible for both saving state and
404 * quiescing or powering down the device.
405 *
406 * This is only called by the device PM core, so we let them handle
407 * all synchronization.
408 */
409int sysdev_suspend(pm_message_t state)
410{
411 struct sysdev_class *cls;
412 struct sys_device *sysdev, *err_dev;
413 struct sysdev_driver *drv, *err_drv;
414 int ret;
415
416 pr_debug("Checking wake-up interrupts\n");
417
418 /* Return error code if there are any wake-up interrupts pending */
419 ret = check_wakeup_irqs();
420 if (ret)
421 return ret;
422
423 WARN_ONCE(!irqs_disabled(),
424 "Interrupts enabled while suspending system devices\n");
425
426 pr_debug("Suspending System Devices\n");
427
428 list_for_each_entry_reverse(cls, &system_kset->list, kset.kobj.entry) {
429 pr_debug("Suspending type '%s':\n",
430 kobject_name(&cls->kset.kobj));
431
432 list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
433 pr_debug(" %s\n", kobject_name(&sysdev->kobj));
434
435 /* Call auxiliary drivers first */
436 list_for_each_entry(drv, &cls->drivers, entry) {
437 if (drv->suspend) {
438 ret = drv->suspend(sysdev, state);
439 if (ret)
440 goto aux_driver;
441 }
442 WARN_ONCE(!irqs_disabled(),
443 "Interrupts enabled after %pF\n",
444 drv->suspend);
445 }
446
447 /* Now call the generic one */
448 if (cls->suspend) {
449 ret = cls->suspend(sysdev, state);
450 if (ret)
451 goto cls_driver;
452 WARN_ONCE(!irqs_disabled(),
453 "Interrupts enabled after %pF\n",
454 cls->suspend);
455 }
456 }
457 }
458 return 0;
459 /* resume current sysdev */
460cls_driver:
461 drv = NULL;
462 printk(KERN_ERR "Class suspend failed for %s: %d\n",
463 kobject_name(&sysdev->kobj), ret);
464
465aux_driver:
466 if (drv)
467 printk(KERN_ERR "Class driver suspend failed for %s: %d\n",
468 kobject_name(&sysdev->kobj), ret);
469 list_for_each_entry(err_drv, &cls->drivers, entry) {
470 if (err_drv == drv)
471 break;
472 if (err_drv->resume)
473 err_drv->resume(sysdev);
474 }
475
476 /* resume other sysdevs in current class */
477 list_for_each_entry(err_dev, &cls->kset.list, kobj.entry) {
478 if (err_dev == sysdev)
479 break;
480 pr_debug(" %s\n", kobject_name(&err_dev->kobj));
481 __sysdev_resume(err_dev);
482 }
483
484 /* resume other classes */
485 list_for_each_entry_continue(cls, &system_kset->list, kset.kobj.entry) {
486 list_for_each_entry(err_dev, &cls->kset.list, kobj.entry) {
487 pr_debug(" %s\n", kobject_name(&err_dev->kobj));
488 __sysdev_resume(err_dev);
489 }
490 }
491 return ret;
492}
493EXPORT_SYMBOL_GPL(sysdev_suspend);
494
495/**
496 * sysdev_resume - Bring system devices back to life.
497 *
498 * Similar to sysdev_suspend(), but we iterate the list forwards
499 * to guarantee that parent devices are resumed before their children.
500 *
501 * Note: Interrupts are disabled when called.
502 */
503int sysdev_resume(void)
504{
505 struct sysdev_class *cls;
506
507 WARN_ONCE(!irqs_disabled(),
508 "Interrupts enabled while resuming system devices\n");
509
510 pr_debug("Resuming System Devices\n");
511
512 list_for_each_entry(cls, &system_kset->list, kset.kobj.entry) {
513 struct sys_device *sysdev;
514
515 pr_debug("Resuming type '%s':\n",
516 kobject_name(&cls->kset.kobj));
517
518 list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
519 pr_debug(" %s\n", kobject_name(&sysdev->kobj));
520
521 __sysdev_resume(sysdev);
522 }
523 }
524 return 0;
525}
526EXPORT_SYMBOL_GPL(sysdev_resume);
527#endif /* CONFIG_ARCH_NO_SYSDEV_OPS */
528 333
529int __init system_bus_init(void) 334int __init system_bus_init(void)
530{ 335{
@@ -534,9 +339,6 @@ int __init system_bus_init(void)
534 return 0; 339 return 0;
535} 340}
536 341
537EXPORT_SYMBOL_GPL(sysdev_register);
538EXPORT_SYMBOL_GPL(sysdev_unregister);
539
540#define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr) 342#define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr)
541 343
542ssize_t sysdev_store_ulong(struct sys_device *sysdev, 344ssize_t sysdev_store_ulong(struct sys_device *sysdev,
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index a2eee574784e..0b5366b5be20 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -70,12 +70,7 @@ static int xen_suspend(void *data)
70 70
71 BUG_ON(!irqs_disabled()); 71 BUG_ON(!irqs_disabled());
72 72
73 err = sysdev_suspend(PMSG_FREEZE); 73 err = syscore_suspend();
74 if (!err) {
75 err = syscore_suspend();
76 if (err)
77 sysdev_resume();
78 }
79 if (err) { 74 if (err) {
80 printk(KERN_ERR "xen_suspend: system core suspend failed: %d\n", 75 printk(KERN_ERR "xen_suspend: system core suspend failed: %d\n",
81 err); 76 err);
@@ -102,7 +97,6 @@ static int xen_suspend(void *data)
102 } 97 }
103 98
104 syscore_resume(); 99 syscore_resume();
105 sysdev_resume();
106 100
107 return 0; 101 return 0;
108} 102}
diff --git a/include/linux/device.h b/include/linux/device.h
index ab8dfc095709..ea9db9b0f248 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -633,13 +633,6 @@ static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
633/* drivers/base/power/shutdown.c */ 633/* drivers/base/power/shutdown.c */
634extern void device_shutdown(void); 634extern void device_shutdown(void);
635 635
636#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
637/* drivers/base/sys.c */
638extern void sysdev_shutdown(void);
639#else
640static inline void sysdev_shutdown(void) { }
641#endif
642
643/* debugging and troubleshooting/diagnostic helpers. */ 636/* debugging and troubleshooting/diagnostic helpers. */
644extern const char *dev_driver_string(const struct device *dev); 637extern const char *dev_driver_string(const struct device *dev);
645 638
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 512e09177e57..3c053e2beb84 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -529,14 +529,6 @@ struct dev_power_domain {
529 */ 529 */
530 530
531#ifdef CONFIG_PM_SLEEP 531#ifdef CONFIG_PM_SLEEP
532#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
533extern int sysdev_suspend(pm_message_t state);
534extern int sysdev_resume(void);
535#else
536static inline int sysdev_suspend(pm_message_t state) { return 0; }
537static inline int sysdev_resume(void) { return 0; }
538#endif
539
540extern void device_pm_lock(void); 532extern void device_pm_lock(void);
541extern void dpm_resume_noirq(pm_message_t state); 533extern void dpm_resume_noirq(pm_message_t state);
542extern void dpm_resume_end(pm_message_t state); 534extern void dpm_resume_end(pm_message_t state);
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index dfb078db8ebb..d35e783a598c 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -34,12 +34,6 @@ struct sysdev_class {
34 struct list_head drivers; 34 struct list_head drivers;
35 struct sysdev_class_attribute **attrs; 35 struct sysdev_class_attribute **attrs;
36 struct kset kset; 36 struct kset kset;
37#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
38 /* Default operations for these types of devices */
39 int (*shutdown)(struct sys_device *);
40 int (*suspend)(struct sys_device *, pm_message_t state);
41 int (*resume)(struct sys_device *);
42#endif
43}; 37};
44 38
45struct sysdev_class_attribute { 39struct sysdev_class_attribute {
@@ -77,11 +71,6 @@ struct sysdev_driver {
77 struct list_head entry; 71 struct list_head entry;
78 int (*add)(struct sys_device *); 72 int (*add)(struct sys_device *);
79 int (*remove)(struct sys_device *); 73 int (*remove)(struct sys_device *);
80#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
81 int (*shutdown)(struct sys_device *);
82 int (*suspend)(struct sys_device *, pm_message_t state);
83 int (*resume)(struct sys_device *);
84#endif
85}; 74};
86 75
87 76
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 87b77de03dd3..8d814cbc8109 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1531,13 +1531,7 @@ int kernel_kexec(void)
1531 if (error) 1531 if (error)
1532 goto Enable_cpus; 1532 goto Enable_cpus;
1533 local_irq_disable(); 1533 local_irq_disable();
1534 /* Suspend system devices */ 1534 error = syscore_suspend();
1535 error = sysdev_suspend(PMSG_FREEZE);
1536 if (!error) {
1537 error = syscore_suspend();
1538 if (error)
1539 sysdev_resume();
1540 }
1541 if (error) 1535 if (error)
1542 goto Enable_irqs; 1536 goto Enable_irqs;
1543 } else 1537 } else
@@ -1553,7 +1547,6 @@ int kernel_kexec(void)
1553#ifdef CONFIG_KEXEC_JUMP 1547#ifdef CONFIG_KEXEC_JUMP
1554 if (kexec_image->preserve_context) { 1548 if (kexec_image->preserve_context) {
1555 syscore_resume(); 1549 syscore_resume();
1556 sysdev_resume();
1557 Enable_irqs: 1550 Enable_irqs:
1558 local_irq_enable(); 1551 local_irq_enable();
1559 Enable_cpus: 1552 Enable_cpus:
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 50aae660174d..554d3b049f35 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -272,12 +272,7 @@ static int create_image(int platform_mode)
272 272
273 local_irq_disable(); 273 local_irq_disable();
274 274
275 error = sysdev_suspend(PMSG_FREEZE); 275 error = syscore_suspend();
276 if (!error) {
277 error = syscore_suspend();
278 if (error)
279 sysdev_resume();
280 }
281 if (error) { 276 if (error) {
282 printk(KERN_ERR "PM: Some system devices failed to power down, " 277 printk(KERN_ERR "PM: Some system devices failed to power down, "
283 "aborting hibernation\n"); 278 "aborting hibernation\n");
@@ -302,7 +297,6 @@ static int create_image(int platform_mode)
302 297
303 Power_up: 298 Power_up:
304 syscore_resume(); 299 syscore_resume();
305 sysdev_resume();
306 /* NOTE: dpm_resume_noirq() is just a resume() for devices 300 /* NOTE: dpm_resume_noirq() is just a resume() for devices
307 * that suspended with irqs off ... no overall powerup. 301 * that suspended with irqs off ... no overall powerup.
308 */ 302 */
@@ -409,12 +403,7 @@ static int resume_target_kernel(bool platform_mode)
409 403
410 local_irq_disable(); 404 local_irq_disable();
411 405
412 error = sysdev_suspend(PMSG_QUIESCE); 406 error = syscore_suspend();
413 if (!error) {
414 error = syscore_suspend();
415 if (error)
416 sysdev_resume();
417 }
418 if (error) 407 if (error)
419 goto Enable_irqs; 408 goto Enable_irqs;
420 409
@@ -442,7 +431,6 @@ static int resume_target_kernel(bool platform_mode)
442 touch_softlockup_watchdog(); 431 touch_softlockup_watchdog();
443 432
444 syscore_resume(); 433 syscore_resume();
445 sysdev_resume();
446 434
447 Enable_irqs: 435 Enable_irqs:
448 local_irq_enable(); 436 local_irq_enable();
@@ -528,7 +516,6 @@ int hibernation_platform_enter(void)
528 goto Platform_finish; 516 goto Platform_finish;
529 517
530 local_irq_disable(); 518 local_irq_disable();
531 sysdev_suspend(PMSG_HIBERNATE);
532 syscore_suspend(); 519 syscore_suspend();
533 if (pm_wakeup_pending()) { 520 if (pm_wakeup_pending()) {
534 error = -EAGAIN; 521 error = -EAGAIN;
@@ -541,7 +528,6 @@ int hibernation_platform_enter(void)
541 528
542 Power_up: 529 Power_up:
543 syscore_resume(); 530 syscore_resume();
544 sysdev_resume();
545 local_irq_enable(); 531 local_irq_enable();
546 enable_nonboot_cpus(); 532 enable_nonboot_cpus();
547 533
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 8935369d503a..732d77a957e7 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -163,19 +163,13 @@ static int suspend_enter(suspend_state_t state)
163 arch_suspend_disable_irqs(); 163 arch_suspend_disable_irqs();
164 BUG_ON(!irqs_disabled()); 164 BUG_ON(!irqs_disabled());
165 165
166 error = sysdev_suspend(PMSG_SUSPEND); 166 error = syscore_suspend();
167 if (!error) {
168 error = syscore_suspend();
169 if (error)
170 sysdev_resume();
171 }
172 if (!error) { 167 if (!error) {
173 if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { 168 if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) {
174 error = suspend_ops->enter(state); 169 error = suspend_ops->enter(state);
175 events_check_enabled = false; 170 events_check_enabled = false;
176 } 171 }
177 syscore_resume(); 172 syscore_resume();
178 sysdev_resume();
179 } 173 }
180 174
181 arch_suspend_enable_irqs(); 175 arch_suspend_enable_irqs();
diff --git a/kernel/sys.c b/kernel/sys.c
index af468edf096a..f0c10385f30c 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -315,7 +315,6 @@ void kernel_restart_prepare(char *cmd)
315 blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); 315 blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
316 system_state = SYSTEM_RESTART; 316 system_state = SYSTEM_RESTART;
317 device_shutdown(); 317 device_shutdown();
318 sysdev_shutdown();
319 syscore_shutdown(); 318 syscore_shutdown();
320} 319}
321 320
@@ -354,7 +353,6 @@ static void kernel_shutdown_prepare(enum system_states state)
354void kernel_halt(void) 353void kernel_halt(void)
355{ 354{
356 kernel_shutdown_prepare(SYSTEM_HALT); 355 kernel_shutdown_prepare(SYSTEM_HALT);
357 sysdev_shutdown();
358 syscore_shutdown(); 356 syscore_shutdown();
359 printk(KERN_EMERG "System halted.\n"); 357 printk(KERN_EMERG "System halted.\n");
360 kmsg_dump(KMSG_DUMP_HALT); 358 kmsg_dump(KMSG_DUMP_HALT);
@@ -374,7 +372,6 @@ void kernel_power_off(void)
374 if (pm_power_off_prepare) 372 if (pm_power_off_prepare)
375 pm_power_off_prepare(); 373 pm_power_off_prepare();
376 disable_nonboot_cpus(); 374 disable_nonboot_cpus();
377 sysdev_shutdown();
378 syscore_shutdown(); 375 syscore_shutdown();
379 printk(KERN_EMERG "Power down.\n"); 376 printk(KERN_EMERG "Power down.\n");
380 kmsg_dump(KMSG_DUMP_POWEROFF); 377 kmsg_dump(KMSG_DUMP_POWEROFF);