]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/viocons.c
[POWERPC] iSeries: Remove unused mail address
[linux-2.6-omap-h63xx.git] / drivers / char / viocons.c
index 0e0da443cbd57d545e2875a93dcecaee7d2c5639..65fb848e1cce0492d908b8dad5f980b6146c05cb 100644 (file)
@@ -7,7 +7,7 @@
  *  Authors: Dave Boutcher <boutcher@us.ibm.com>
  *           Ryan Arnold <ryanarn@us.ibm.com>
  *           Colin Devilbiss <devilbis@us.ibm.com>
- *           Stephen Rothwell <sfr@au1.ibm.com>
+ *           Stephen Rothwell
  *
  * (C) Copyright 2000, 2001, 2002, 2003, 2004 IBM Corporation
  *
@@ -42,6 +42,7 @@
 #include <linux/tty_flip.h>
 #include <linux/sysrq.h>
 
+#include <asm/firmware.h>
 #include <asm/iseries/vio.h>
 #include <asm/iseries/hv_lp_event.h>
 #include <asm/iseries/hv_call_event.h>
@@ -627,13 +628,13 @@ static int viotty_write(struct tty_struct *tty, const unsigned char *buf,
 /*
  * TTY put_char method
  */
-static void viotty_put_char(struct tty_struct *tty, unsigned char ch)
+static int viotty_put_char(struct tty_struct *tty, unsigned char ch)
 {
        struct port_info *pi;
 
        pi = get_port_data(tty);
        if (pi == NULL)
-               return;
+               return 0;
 
        /* This will append '\r' as well if the char is '\n' */
        if (viochar_is_console(pi))
@@ -641,6 +642,7 @@ static void viotty_put_char(struct tty_struct *tty, unsigned char ch)
 
        if (viopath_isactive(pi->lp))
                internal_write(pi, &ch, 1);
+       return 1;
 }
 
 /*
@@ -703,8 +705,11 @@ static int viotty_ioctl(struct tty_struct *tty, struct file *file,
        case KDSKBLED:
                return 0;
        }
-
-       return n_tty_ioctl(tty, file, cmd, arg);
+       /* FIXME: WTF is this being called for ??? */
+       lock_kernel();
+       ret =  n_tty_ioctl(tty, file, cmd, arg);
+       unlock_kernel();
+       return ret;
 }
 
 /*
@@ -1060,6 +1065,9 @@ static int __init viocons_init2(void)
        atomic_t wait_flag;
        int rc;
 
+       if (!firmware_has_feature(FW_FEATURE_ISERIES))
+               return -ENODEV;
+
        /* +2 for fudge */
        rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
                        viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
@@ -1145,6 +1153,9 @@ static int __init viocons_init(void)
 {
        int i;
 
+       if (!firmware_has_feature(FW_FEATURE_ISERIES))
+               return -ENODEV;
+
        printk(VIOCONS_KERN_INFO "registering console\n");
        for (i = 0; i < VTTY_PORTS; i++) {
                port_info[i].lp = HvLpIndexInvalid;