drivers: Push down BKL into various drivers
[safe/jmp/linux-2.6] / drivers / char / hvc_vio.c
index 79711aa..27370e9 100644 (file)
@@ -77,9 +77,12 @@ static int filtered_get_chars(uint32_t vtermno, char *buf, int count)
        return got;
 }
 
-static struct hv_ops hvc_get_put_ops = {
+static const struct hv_ops hvc_get_put_ops = {
        .get_chars = filtered_get_chars,
        .put_chars = hvc_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,
@@ -110,14 +113,14 @@ 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,
        }
 };
 
-static int hvc_vio_init(void)
+static int __init hvc_vio_init(void)
 {
        int rc;
 
@@ -131,7 +134,7 @@ 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);
 }
@@ -150,8 +153,10 @@ static int hvc_find_vtys(void)
                /* We have statically defined space for only a certain number
                 * of console adapters.
                 */
-               if (num_found >= MAX_NR_HVC_CONSOLES)
+               if (num_found >= MAX_NR_HVC_CONSOLES) {
+                       of_node_put(vty);
                        break;
+               }
 
                vtermno = of_get_property(vty, "reg", NULL);
                if (!vtermno)