Lines Matching refs:dn
79 struct device_node *dn;
82 dn = kzalloc(sizeof(*dn), GFP_KERNEL);
83 if (!dn)
87 dn->full_name = kstrdup(name, GFP_KERNEL);
88 if (!dn->full_name) {
89 kfree(dn);
93 of_node_set_flag(dn, OF_DYNAMIC);
94 of_node_init(dn);
96 return dn;
99 static void dlpar_free_one_cc_node(struct device_node *dn)
103 while (dn->properties) {
104 prop = dn->properties;
105 dn->properties = prop->next;
109 kfree(dn->full_name);
110 kfree(dn);
113 void dlpar_free_cc_nodes(struct device_node *dn)
115 if (dn->child)
116 dlpar_free_cc_nodes(dn->child);
118 if (dn->sibling)
119 dlpar_free_cc_nodes(dn->sibling);
121 dlpar_free_one_cc_node(dn);
135 struct device_node *dn;
168 dn = dlpar_parse_cc_node(ccwa);
169 if (!dn)
172 dn->parent = last_dn->parent;
173 last_dn->sibling = dn;
174 last_dn = dn;
178 dn = dlpar_parse_cc_node(ccwa);
179 if (!dn)
183 dn->parent = parent;
184 first_dn = dn;
186 dn->parent = last_dn;
188 last_dn->child = dn;
191 last_dn = dn;
233 int dlpar_attach_node(struct device_node *dn, struct device_node *parent)
237 dn->parent = parent;
239 rc = of_attach_node(dn);
241 printk(KERN_ERR "Failed to add device node %pOF\n", dn);
248 int dlpar_detach_node(struct device_node *dn)
253 child = of_get_next_child(dn, NULL);
256 child = of_get_next_child(dn, child);
259 rc = of_detach_node(dn);
263 of_node_put(dn);