]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/power.c
sparc: don't use asm/of_device.h
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / power.c
index 7471e844724dc8071a9b074d6c653aced6ddbb94..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
@@ -83,7 +82,7 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
 
        power_reg = of_ioremap(res, 0, 0x4, "power");
 
-       printk("%s: Control reg at %lx ... ",
+       printk(KERN_INFO "%s: Control reg at %lx\n",
               op->node->name, res->start);
 
        poweroff_method = machine_halt;  /* able to use the standard halt */
@@ -92,8 +91,6 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
                if (request_irq(irq,
                                power_handler, 0, "power", NULL) < 0)
                        printk(KERN_ERR "power: Cannot setup IRQ handler.\n");
-       } else {
-               printk(KERN_INFO "power: Not using powerd.\n");
        }
 
        return 0;
@@ -107,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;
 }