NFSv4: Remove BKL from the nfsv4 state recovery
[pandora-kernel.git] / drivers / char / hvc_iseries.c
index 4747729..a08f8f9 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);
 
@@ -476,7 +472,7 @@ static void hvc_handle_event(struct HvLpEvent *event)
        }
 }
 
-static int send_open(HvLpIndex remoteLp, void *sem)
+static int __init send_open(HvLpIndex remoteLp, void *sem)
 {
        return HvCallEvent_signalLpEventFast(remoteLp,
                        HvLpEvent_Type_VirtualIo,
@@ -488,11 +484,14 @@ static int send_open(HvLpIndex remoteLp, void *sem)
                        0, 0, 0, 0);
 }
 
-static int hvc_vio_init(void)
+static int __init 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);
@@ -553,21 +552,21 @@ static int hvc_vio_init(void)
 }
 module_init(hvc_vio_init); /* after drivers/char/hvc_console.c */
 
-static void hvc_vio_exit(void)
+static void __exit hvc_vio_exit(void)
 {
        vio_unregister_driver(&hvc_vio_driver);
 }
 module_exit(hvc_vio_exit);
 
 /* the device tree order defines our numbering */
-static int hvc_find_vtys(void)
+static int __init hvc_find_vtys(void)
 {
        struct device_node *vty;
        int num_found = 0;
 
        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)