Exemplo n.º 1
0
static struct device_node * __init of_pdt_build_tree(struct device_node *parent,
						   phandle node,
						   struct device_node ***nextp)
{
	struct device_node *ret = NULL, *prev_sibling = NULL;
	struct device_node *dp;

	while (1) {
		dp = of_pdt_create_node(node, parent);
		if (!dp)
			break;

		if (prev_sibling)
			prev_sibling->sibling = dp;

		if (!ret)
			ret = dp;
		prev_sibling = dp;

		*(*nextp) = dp;
		*nextp = &dp->allnext;

		dp->full_name = of_pdt_build_full_name(dp);

		dp->child = of_pdt_build_tree(dp,
				of_pdt_prom_ops->getchild(node), nextp);

		if (of_pdt_build_more)
			of_pdt_build_more(dp, nextp);

		node = of_pdt_prom_ops->getsibling(node);
	}

	return ret;
}
Exemplo n.º 2
0
void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops)
{
	struct device_node **nextp;

	BUG_ON(!ops);
	of_pdt_prom_ops = ops;

	allnodes = of_pdt_create_node(root_node, NULL);
#if defined(CONFIG_SPARC)
	allnodes->path_component_name = "";
#endif
	allnodes->full_name = "/";

	nextp = &allnodes->allnext;
	allnodes->child = of_pdt_build_tree(allnodes,
			of_pdt_prom_ops->getchild(allnodes->phandle), &nextp);
}
Exemplo n.º 3
0
Arquivo: pdt.c Projeto: Lyude/linux
void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops)
{
	BUG_ON(!ops);
	of_pdt_prom_ops = ops;

	of_root = of_pdt_create_node(root_node, NULL);
#if defined(CONFIG_SPARC)
	of_root->path_component_name = "";
#endif
	of_root->full_name = "/";

	of_root->child = of_pdt_build_tree(of_root,
				of_pdt_prom_ops->getchild(of_root->phandle));

	/* Get pointer to "/chosen" and "/aliases" nodes for use everywhere */
	of_alias_scan(kernel_tree_alloc);
}