summaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunhv.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-21 22:56:20 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-23 23:15:13 -0700
commit6760d28bc691bb255c501c9b680f2fc1162258b2 (patch)
tree8c6a249a56fc2a2eee995dbcb55daf4adf456705 /drivers/serial/sunhv.c
parent27cc64c7cc9e41788e53655c717aeca2f55f2041 (diff)
downloadop-kernel-dev-6760d28bc691bb255c501c9b680f2fc1162258b2.zip
op-kernel-dev-6760d28bc691bb255c501c9b680f2fc1162258b2.tar.gz
[SPARC64]: Convert sun4v virtual-device layer to in-kernel PROM device tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/serial/sunhv.c')
-rw-r--r--drivers/serial/sunhv.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index f137804..ba22e25 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)
static unsigned int __init get_interrupt(void)
{
- const char *cons_str = "console";
- const char *compat_str = "compatible";
- int node = prom_getchild(sun4v_vdev_root);
- char buf[64];
- int err, len;
-
- node = prom_searchsiblings(node, cons_str);
- if (!node)
- return 0;
+ struct device_node *dev_node;
- len = prom_getproplen(node, compat_str);
- if (len == 0 || len == -1)
- return 0;
+ dev_node = sun4v_vdev_root->child;
+ while (dev_node != NULL) {
+ struct property *prop;
- err = prom_getproperty(node, compat_str, buf, 64);
- if (err == -1)
- return 0;
+ if (strcmp(dev_node->name, "console"))
+ goto next_sibling;
+
+ prop = of_find_property(dev_node, "compatible", NULL);
+ if (!prop)
+ goto next_sibling;
- if (!hv_console_compatible(buf, len))
+ if (hv_console_compatible(prop->value, prop->length))
+ break;
+
+ next_sibling:
+ dev_node = dev_node->sibling;
+ }
+ if (!dev_node)
return 0;
/* Ok, the this is the OBP node for the sun4v hypervisor
* console device. Decode the interrupt.
*/
- return sun4v_vdev_device_interrupt(node);
+ return sun4v_vdev_device_interrupt(dev_node);
}
static int __init sunhv_init(void)
OpenPOWER on IntegriCloud