Lines Matching refs:np
44 void __of_detach_node_sysfs(struct device_node *np) in __of_detach_node_sysfs() argument
51 BUG_ON(!of_node_is_initialized(np)); in __of_detach_node_sysfs()
56 if (of_node_is_attached(np)) { in __of_detach_node_sysfs()
57 for_each_property_of_node(np, pp) in __of_detach_node_sysfs()
58 sysfs_remove_bin_file(&np->kobj, &pp->attr); in __of_detach_node_sysfs()
59 kobject_del(&np->kobj); in __of_detach_node_sysfs()
63 of_node_put(np); in __of_detach_node_sysfs()
202 int of_property_notify(int action, struct device_node *np, in of_property_notify() argument
208 if (!of_node_is_attached(np)) in of_property_notify()
211 pr.dn = np; in of_property_notify()
217 void __of_attach_node(struct device_node *np) in __of_attach_node() argument
222 np->name = __of_get_property(np, "name", NULL) ? : "<NULL>"; in __of_attach_node()
223 np->type = __of_get_property(np, "device_type", NULL) ? : "<NULL>"; in __of_attach_node()
225 phandle = __of_get_property(np, "phandle", &sz); in __of_attach_node()
227 phandle = __of_get_property(np, "linux,phandle", &sz); in __of_attach_node()
229 phandle = __of_get_property(np, "ibm,phandle", &sz); in __of_attach_node()
230 np->phandle = (phandle && (sz >= 4)) ? be32_to_cpup(phandle) : 0; in __of_attach_node()
232 np->child = NULL; in __of_attach_node()
233 np->sibling = np->parent->child; in __of_attach_node()
234 np->parent->child = np; in __of_attach_node()
235 of_node_clear_flag(np, OF_DETACHED); in __of_attach_node()
241 int of_attach_node(struct device_node *np) in of_attach_node() argument
247 rd.dn = np; in of_attach_node()
251 __of_attach_node(np); in of_attach_node()
254 __of_attach_node_sysfs(np); in of_attach_node()
262 void __of_detach_node(struct device_node *np) in __of_detach_node() argument
266 if (WARN_ON(of_node_check_flag(np, OF_DETACHED))) in __of_detach_node()
269 parent = np->parent; in __of_detach_node()
273 if (parent->child == np) in __of_detach_node()
274 parent->child = np->sibling; in __of_detach_node()
277 for (prevsib = np->parent->child; in __of_detach_node()
278 prevsib->sibling != np; in __of_detach_node()
281 prevsib->sibling = np->sibling; in __of_detach_node()
284 of_node_set_flag(np, OF_DETACHED); in __of_detach_node()
293 int of_detach_node(struct device_node *np) in of_detach_node() argument
300 rd.dn = np; in of_detach_node()
304 __of_detach_node(np); in of_detach_node()
307 __of_detach_node_sysfs(np); in of_detach_node()
406 struct device_node *__of_node_dup(const struct device_node *np, const char *fmt, ...) in __of_node_dup() argument
427 if (np) { in __of_node_dup()
429 for_each_property_of_node(np, pp) { in __of_node_dup()
450 of_node_put(ce->np); in __of_changeset_entry_destroy()
463 ce->np->full_name, ce->prop->name); in __of_changeset_entry_dump()
468 ce->np->full_name); in __of_changeset_entry_dump()
519 rd.dn = ce->np; in __of_changeset_entry_notify()
525 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_notify()
534 pr_err("%s: notifier error @%s\n", __func__, ce->np->full_name); in __of_changeset_entry_notify()
548 __of_attach_node(ce->np); in __of_changeset_entry_apply()
551 __of_detach_node(ce->np); in __of_changeset_entry_apply()
555 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) { in __of_changeset_entry_apply()
563 ret = __of_add_property(ce->np, ce->prop); in __of_changeset_entry_apply()
566 __func__, ce->np->full_name, in __of_changeset_entry_apply()
572 ret = __of_remove_property(ce->np, ce->prop); in __of_changeset_entry_apply()
575 __func__, ce->np->full_name, in __of_changeset_entry_apply()
583 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) { in __of_changeset_entry_apply()
591 ret = __of_update_property(ce->np, ce->prop, &old_prop); in __of_changeset_entry_apply()
594 __func__, ce->np->full_name, in __of_changeset_entry_apply()
609 __of_attach_node_sysfs(ce->np); in __of_changeset_entry_apply()
612 __of_detach_node_sysfs(ce->np); in __of_changeset_entry_apply()
616 __of_add_property_sysfs(ce->np, ce->prop); in __of_changeset_entry_apply()
619 __of_remove_property_sysfs(ce->np, ce->prop); in __of_changeset_entry_apply()
622 __of_update_property_sysfs(ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_apply()
761 struct device_node *np, struct property *prop) in of_changeset_action() argument
772 ce->np = of_node_get(np); in of_changeset_action()
776 ce->old_prop = of_find_property(np, prop->name, NULL); in of_changeset_action()