/* * When fetching the node's name, first try using package-to-path; if * that fails (either because the arch hasn't supplied a PROM callback, * or some other random failure), fall back to just looking at the node's * 'name' property. */ static char * __init of_pdt_build_name(phandle node) { char *buf; buf = of_pdt_try_pkg2path(node); if (!buf) buf = of_pdt_get_one_property(node, "name"); return buf; }
static struct device_node * __init of_pdt_create_node(phandle node, struct device_node *parent) { struct device_node *dp; if (!node) return NULL; dp = prom_early_alloc(sizeof(*dp)); of_node_init(dp); of_pdt_incr_unique_id(dp); dp->parent = parent; dp->name = of_pdt_get_one_property(node, "name"); dp->type = of_pdt_get_one_property(node, "device_type"); dp->phandle = node; dp->properties = of_pdt_build_prop_list(node); irq_trans_init(dp); return dp; }