X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fchar%2Fhvc_iseries.c;h=936d05bf37fa3264ae48ec539f0787d6a1a7c3cc;hb=dc7a08166f3a5f23e79e839a8a88849bd3397c32;hp=8b6f197e5f8cbce32a307bec1be4d66846b43103;hpb=d86d9b8cab45adf64e2ea8fe975bec3282b5de81;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c index 8b6f197..936d05b 100644 --- a/drivers/char/hvc_iseries.c +++ b/drivers/char/hvc_iseries.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -199,6 +200,9 @@ done: static 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, @@ -237,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, @@ -471,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, @@ -483,11 +487,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); @@ -548,34 +555,36 @@ 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. */ if ((num_found >= MAX_NR_HVC_CONSOLES) || - (num_found >= VTTY_PORTS)) + (num_found >= VTTY_PORTS)) { + of_node_put(vty); 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)