Lines Matching defs:phandle
510 struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
514 assert((phandle != 0) && (phandle != -1));
516 if (tree->phandle == phandle) {
523 node = get_node_by_phandle(child, phandle);
543 static cell_t phandle = 1; /* FIXME: ick, static local */
545 if ((node->phandle != 0) && (node->phandle != -1))
546 return node->phandle;
548 while (get_node_by_phandle(root, phandle))
549 phandle++;
551 node->phandle = phandle;
553 if (!get_property(node, "linux,phandle")
556 build_property("linux,phandle",
557 data_append_cell(empty_data, phandle)));
559 if (!get_property(node, "phandle")
562 build_property("phandle",
563 data_append_cell(empty_data, phandle)));
565 /* If the node *does* have a phandle property, we must
566 * be dealing with a self-referencing phandle, which will be
569 return node->phandle;
803 /* force allocation of a phandle for this node */