Lines Matching full:np

185 int of_property_notify(int action, struct device_node *np,  in of_property_notify()  argument
191 if (!of_node_is_attached(np)) in of_property_notify()
194 pr.dn = np; in of_property_notify()
200 static void __of_attach_node(struct device_node *np) in __of_attach_node() argument
208 if (!of_node_check_flag(np, OF_OVERLAY)) { in __of_attach_node()
209 np->name = __of_get_property(np, "name", NULL); in __of_attach_node()
210 if (!np->name) in __of_attach_node()
211 np->name = "<NULL>"; in __of_attach_node()
213 phandle = __of_get_property(np, "phandle", &sz); in __of_attach_node()
215 phandle = __of_get_property(np, "linux,phandle", &sz); in __of_attach_node()
217 phandle = __of_get_property(np, "ibm,phandle", &sz); in __of_attach_node()
219 np->phandle = be32_to_cpup(phandle); in __of_attach_node()
221 np->phandle = 0; in __of_attach_node()
224 np->child = NULL; in __of_attach_node()
225 np->sibling = np->parent->child; in __of_attach_node()
226 np->parent->child = np; in __of_attach_node()
227 of_node_clear_flag(np, OF_DETACHED); in __of_attach_node()
228 np->fwnode.flags |= FWNODE_FLAG_NOT_DEVICE; in __of_attach_node()
232 __of_attach_node_sysfs(np); in __of_attach_node()
237 * @np: Pointer to the caller's Device Node
239 int of_attach_node(struct device_node *np) in of_attach_node() argument
244 rd.dn = np; in of_attach_node()
247 __of_attach_node(np); in of_attach_node()
255 void __of_detach_node(struct device_node *np) in __of_detach_node() argument
262 parent = np->parent; in __of_detach_node()
263 if (WARN_ON(of_node_check_flag(np, OF_DETACHED) || !parent)) { in __of_detach_node()
268 if (parent->child == np) in __of_detach_node()
269 parent->child = np->sibling; in __of_detach_node()
272 for (prevsib = np->parent->child; in __of_detach_node()
273 prevsib->sibling != np; in __of_detach_node()
276 prevsib->sibling = np->sibling; in __of_detach_node()
279 of_node_set_flag(np, OF_DETACHED); in __of_detach_node()
282 __of_phandle_cache_inv_entry(np->phandle); in __of_detach_node()
286 __of_detach_node_sysfs(np); in __of_detach_node()
291 * @np: Pointer to the caller's Device Node
293 int of_detach_node(struct device_node *np) in of_detach_node() argument
298 rd.dn = np; in of_detach_node()
301 __of_detach_node(np); in of_detach_node()
442 * @np: if not NULL, contains properties to be duplicated in new node
452 struct device_node *__of_node_dup(const struct device_node *np, in __of_node_dup() argument
471 if (np) { in __of_node_dup()
473 for_each_property_of_node(np, pp) { in __of_node_dup()
504 struct device_node *np; in of_changeset_create_node() local
507 np = __of_node_dup(NULL, full_name); in of_changeset_create_node()
508 if (!np) in of_changeset_create_node()
510 np->parent = parent; in of_changeset_create_node()
512 ret = of_changeset_attach_node(ocs, np); in of_changeset_create_node()
514 of_node_put(np); in of_changeset_create_node()
518 return np; in of_changeset_create_node()
525 of_node_check_flag(ce->np, OF_OVERLAY)) { in __of_changeset_entry_destroy()
526 if (kref_read(&ce->np->kobj.kref) > 1) { in __of_changeset_entry_destroy()
528 kref_read(&ce->np->kobj.kref), ce->np); in __of_changeset_entry_destroy()
530 of_node_set_flag(ce->np, OF_OVERLAY_FREE_CSET); in __of_changeset_entry_destroy()
534 of_node_put(ce->np); in __of_changeset_entry_destroy()
585 rd.dn = ce->np; in __of_changeset_entry_notify()
591 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_notify()
600 pr_err("changeset notifier error @%pOF\n", ce->np); in __of_changeset_entry_notify()
608 of_changeset_action_debug("apply: ", ce->action, ce->np, ce->prop); in __of_changeset_entry_apply()
612 __of_attach_node(ce->np); in __of_changeset_entry_apply()
615 __of_detach_node(ce->np); in __of_changeset_entry_apply()
618 ret = __of_add_property(ce->np, ce->prop); in __of_changeset_entry_apply()
621 ret = __of_remove_property(ce->np, ce->prop); in __of_changeset_entry_apply()
625 ret = __of_update_property(ce->np, ce->prop, &ce->old_prop); in __of_changeset_entry_apply()
632 of_changeset_action_err("apply failed: ", ce->action, ce->np, ce->prop); in __of_changeset_entry_apply()
891 * @np: Pointer to device node
904 struct device_node *np, struct property *prop) in of_changeset_action() argument
917 ce->np = of_node_get(np); in of_changeset_action()
927 struct device_node *np, in of_changeset_add_prop_helper() argument
937 ret = of_changeset_add_property(ocs, np, new_pp); in of_changeset_add_prop_helper()
948 * @np: device node pointer
957 struct device_node *np, in of_changeset_add_prop_string() argument
966 return of_changeset_add_prop_helper(ocs, np, &prop); in of_changeset_add_prop_string()
975 * @np: device node pointer
985 struct device_node *np, in of_changeset_add_prop_string_array() argument
1008 ret = of_changeset_add_prop_helper(ocs, np, &prop); in of_changeset_add_prop_string_array()
1020 * @np: device node pointer
1030 struct device_node *np, in of_changeset_add_prop_u32_array() argument
1047 return of_changeset_add_prop_helper(ocs, np, &prop); in of_changeset_add_prop_u32_array()
1056 * @np: device node pointer
1063 int of_changeset_add_prop_bool(struct of_changeset *ocs, struct device_node *np, in of_changeset_add_prop_bool() argument
1072 return of_changeset_add_prop_helper(ocs, np, &prop); in of_changeset_add_prop_bool()
1077 struct device_node *np, in of_changeset_update_prop_helper() argument
1087 ret = of_changeset_update_property(ocs, np, new_pp); in of_changeset_update_prop_helper()
1098 * @np: device node pointer
1107 struct device_node *np, in of_changeset_update_prop_string() argument
1116 return of_changeset_update_prop_helper(ocs, np, &prop); in of_changeset_update_prop_string()