]> err.no Git - linux-2.6/blobdiff - arch/sparc64/kernel/power.c
Merge branch 'for-linus' of git://neil.brown.name/md
[linux-2.6] / arch / sparc64 / kernel / power.c
index 39f9f6494d4c2f5486ca8d108d23a7922af6efd6..3bb987a6d03cba183d94039c93e39d94f8bd7509 100644 (file)
 #include <linux/pm.h>
 #include <linux/syscalls.h>
 #include <linux/reboot.h>
+#include <linux/of_device.h>
 
 #include <asm/system.h>
 #include <asm/auxio.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/io.h>
 #include <asm/sstate.h>
+#include <asm/reboot.h>
 
 #include <linux/unistd.h>
 
@@ -39,14 +40,12 @@ static irqreturn_t power_handler(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-extern void machine_halt(void);
-extern void machine_alt_power_off(void);
 static void (*poweroff_method)(void) = machine_alt_power_off;
 
 void machine_power_off(void)
 {
        sstate_poweroff();
-       if (!serial_console || scons_pwroff) {
+       if (strcmp(of_console_device->type, "serial") || scons_pwroff) {
                if (power_reg) {
                        /* Both register bits seem to have the
                         * same effect, so until I figure out
@@ -105,13 +104,15 @@ static struct of_device_id power_match[] = {
 };
 
 static struct of_platform_driver power_driver = {
-       .name           = "power",
        .match_table    = power_match,
        .probe          = power_probe,
+       .driver         = {
+               .name   = "power",
+       },
 };
 
 void __init power_init(void)
 {
-       of_register_driver(&power_driver, &of_bus_type);
+       of_register_driver(&power_driver, &of_platform_bus_type);
        return;
 }