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;
178 dn = dlpar_parse_cc_node(ccwa);
179 if (!dn)
182 dn->parent = last_dn->parent;
183 last_dn->sibling = dn;
184 last_dn = dn;
188 dn = dlpar_parse_cc_node(ccwa);
189 if (!dn)
193 dn->parent = parent;
194 first_dn = dn;
196 dn->parent = last_dn;
198 last_dn->child = dn;
201 last_dn = dn;
243 int dlpar_attach_node(struct device_node *dn, struct device_node *parent)
247 dn->parent = parent;
249 rc = of_attach_node(dn);
251 printk(KERN_ERR "Failed to add device node %pOF\n", dn);
258 int dlpar_detach_node(struct device_node *dn)
263 child = of_get_next_child(dn, NULL);
266 child = of_get_next_child(dn, child);
269 rc = of_detach_node(dn);
273 of_node_put(dn);