]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/char/sclp_vt220.c
PCI hotplug: fix logic in Compaq hotplug controller bus speed setup
[linux-2.6-omap-h63xx.git] / drivers / s390 / char / sclp_vt220.c
index ad51738c4261973a7f4fb8b74296dc5dcc17bb85..9854f19f5e624532a754d7b7654c286d9601f75e 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/bootmem.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/reboot.h>
+
 #include <asm/uaccess.h>
 #include "sclp.h"
 
@@ -743,24 +745,30 @@ sclp_vt220_con_device(struct console *c, int *index)
        return sclp_vt220_driver;
 }
 
-/*
- * This routine is called from panic when the kernel is going to give up.
- * We have to make sure that all buffers will be flushed to the SCLP.
- * Note that this function may be called from within an interrupt context.
- */
-static void
-sclp_vt220_con_unblank(void)
+static int
+sclp_vt220_notify(struct notifier_block *self,
+                         unsigned long event, void *data)
 {
        __sclp_vt220_flush_buffer();
+       return NOTIFY_OK;
 }
 
+static struct notifier_block on_panic_nb = {
+       .notifier_call = sclp_vt220_notify,
+       .priority = 1,
+};
+
+static struct notifier_block on_reboot_nb = {
+       .notifier_call = sclp_vt220_notify,
+       .priority = 1,
+};
+
 /* Structure needed to register with printk */
 static struct console sclp_vt220_console =
 {
        .name = SCLP_VT220_CONSOLE_NAME,
        .write = sclp_vt220_con_write,
        .device = sclp_vt220_con_device,
-       .unblank = sclp_vt220_con_unblank,
        .flags = CON_PRINTBUFFER,
        .index = SCLP_VT220_CONSOLE_INDEX
 };
@@ -776,6 +784,8 @@ sclp_vt220_con_init(void)
        if (rc)
                return rc;
        /* Attach linux console */
+       atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
+       register_reboot_notifier(&on_reboot_nb);
        register_console(&sclp_vt220_console);
        return 0;
 }