V4L/DVB: gspca - sn9c20x: Add another MSI laptop to upsidedown device list
[safe/jmp/linux-2.6] / drivers / char / hvc_iseries.c
index ea36201..21c5495 100644 (file)
@@ -154,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;
        }
@@ -172,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);
 
@@ -202,9 +197,12 @@ done:
        return sent;
 }
 
-static struct hv_ops hvc_get_put_ops = {
+static const struct hv_ops hvc_get_put_ops = {
        .get_chars = get_chars,
        .put_chars = put_chars,
+       .notifier_add = notifier_add_irq,
+       .notifier_del = notifier_del_irq,
+       .notifier_hangup = notifier_hangup_irq,
 };
 
 static int __devinit hvc_vio_probe(struct vio_dev *vdev,
@@ -243,7 +241,7 @@ static int __devexit hvc_vio_remove(struct vio_dev *vdev)
 static struct vio_driver hvc_vio_driver = {
        .id_table       = hvc_driver_table,
        .probe          = hvc_vio_probe,
-       .remove         = hvc_vio_remove,
+       .remove         = __devexit_p(hvc_vio_remove),
        .driver         = {
                .name   = hvc_driver_name,
                .owner  = THIS_MODULE,
@@ -355,7 +353,7 @@ static void hvc_close_event(struct HvLpEvent *event)
 
        if (!hvlpevent_is_int(event)) {
                printk(KERN_WARNING
-                       "hvc: got unexpected close acknowlegement\n");
+                       "hvc: got unexpected close acknowledgement\n");
                return;
        }
 
@@ -477,7 +475,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,
@@ -489,7 +487,7 @@ 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;
@@ -557,14 +555,14 @@ 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;
@@ -577,14 +575,16 @@ static int hvc_find_vtys(void)
                 * of console adapters.
                 */
                if ((num_found >= MAX_NR_HVC_CONSOLES) ||
-                               (num_found >= VTTY_PORTS))
+                               (num_found >= VTTY_PORTS)) {
+                       of_node_put(vty);
                        break;
+               }
 
-               vtermno = 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)