Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-drm-fsl-dcu.git] / drivers / char / hvc_iseries.c
index 4747729459c7a5a0c0aa29f9ec8a7023d73fc66a..b37f1d5a5be6e19e9604e80b36988573f500d58f 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/hvconsole.h>
 #include <asm/vio.h>
 #include <asm/prom.h>
+#include <asm/firmware.h>
 #include <asm/iseries/vio.h>
 #include <asm/iseries/hv_call.h>
 #include <asm/iseries/hv_lp_config.h>
@@ -153,9 +154,7 @@ static int put_chars(uint32_t vtermno, const char *buf, int count)
        spin_lock_irqsave(&consolelock, flags);
 
        if (viochar_is_console(pi) && !viopath_isactive(pi->lp)) {
-               spin_lock_irqsave(&consoleloglock, flags);
                HvCall_writeLogBuffer(buf, count);
-               spin_unlock_irqrestore(&consoleloglock, flags);
                sent = count;
                goto done;
        }
@@ -171,11 +170,8 @@ static int put_chars(uint32_t vtermno, const char *buf, int count)
 
                len = (count > VIOCHAR_MAX_DATA) ? VIOCHAR_MAX_DATA : count;
 
-               if (viochar_is_console(pi)) {
-                       spin_lock_irqsave(&consoleloglock, flags);
+               if (viochar_is_console(pi))
                        HvCall_writeLogBuffer(buf, len);
-                       spin_unlock_irqrestore(&consoleloglock, flags);
-               }
 
                init_data_event(viochar, pi->lp);
 
@@ -493,6 +489,9 @@ static int hvc_vio_init(void)
        atomic_t wait_flag;
        int rc;
 
+       if (!firmware_has_feature(FW_FEATURE_ISERIES))
+               return -EIO;
+
        /* +2 for fudge */
        rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
                        viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
@@ -567,7 +566,7 @@ static int hvc_find_vtys(void)
 
        for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL;
                        vty = of_find_node_by_name(vty, "vty")) {
-               uint32_t *vtermno;
+               const uint32_t *vtermno;
 
                /* We have statically defined space for only a certain number
                 * of console adapters.
@@ -576,11 +575,11 @@ static int hvc_find_vtys(void)
                                (num_found >= VTTY_PORTS))
                        break;
 
-               vtermno = (uint32_t *)get_property(vty, "reg", NULL);
+               vtermno = of_get_property(vty, "reg", NULL);
                if (!vtermno)
                        continue;
 
-               if (!device_is_compatible(vty, "IBM,iSeries-vty"))
+               if (!of_device_is_compatible(vty, "IBM,iSeries-vty"))
                        continue;
 
                if (num_found == 0)