diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/sunhv.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c index f137804b3133..ba22e256c6f7 100644 --- a/drivers/serial/sunhv.c +++ b/drivers/serial/sunhv.c | |||
@@ -427,31 +427,32 @@ static int __init hv_console_compatible(char *buf, int len) | |||
427 | 427 | ||
428 | static unsigned int __init get_interrupt(void) | 428 | static unsigned int __init get_interrupt(void) |
429 | { | 429 | { |
430 | const char *cons_str = "console"; | 430 | struct device_node *dev_node; |
431 | const char *compat_str = "compatible"; | ||
432 | int node = prom_getchild(sun4v_vdev_root); | ||
433 | char buf[64]; | ||
434 | int err, len; | ||
435 | |||
436 | node = prom_searchsiblings(node, cons_str); | ||
437 | if (!node) | ||
438 | return 0; | ||
439 | 431 | ||
440 | len = prom_getproplen(node, compat_str); | 432 | dev_node = sun4v_vdev_root->child; |
441 | if (len == 0 || len == -1) | 433 | while (dev_node != NULL) { |
442 | return 0; | 434 | struct property *prop; |
443 | 435 | ||
444 | err = prom_getproperty(node, compat_str, buf, 64); | 436 | if (strcmp(dev_node->name, "console")) |
445 | if (err == -1) | 437 | goto next_sibling; |
446 | return 0; | 438 | |
439 | prop = of_find_property(dev_node, "compatible", NULL); | ||
440 | if (!prop) | ||
441 | goto next_sibling; | ||
447 | 442 | ||
448 | if (!hv_console_compatible(buf, len)) | 443 | if (hv_console_compatible(prop->value, prop->length)) |
444 | break; | ||
445 | |||
446 | next_sibling: | ||
447 | dev_node = dev_node->sibling; | ||
448 | } | ||
449 | if (!dev_node) | ||
449 | return 0; | 450 | return 0; |
450 | 451 | ||
451 | /* Ok, the this is the OBP node for the sun4v hypervisor | 452 | /* Ok, the this is the OBP node for the sun4v hypervisor |
452 | * console device. Decode the interrupt. | 453 | * console device. Decode the interrupt. |
453 | */ | 454 | */ |
454 | return sun4v_vdev_device_interrupt(node); | 455 | return sun4v_vdev_device_interrupt(dev_node); |
455 | } | 456 | } |
456 | 457 | ||
457 | static int __init sunhv_init(void) | 458 | static int __init sunhv_init(void) |