Lines Matching refs:np

63 int __of_add_property_sysfs(struct device_node *np, struct property *pp)  in __of_add_property_sysfs()  argument
73 if (!of_kset || !of_node_is_attached(np)) in __of_add_property_sysfs()
77 pp->attr.attr.name = safe_name(&np->kobj, pp->name); in __of_add_property_sysfs()
82 rc = sysfs_create_bin_file(&np->kobj, &pp->attr); in __of_add_property_sysfs()
83 WARN(rc, "error adding attribute %s to node %pOF\n", pp->name, np); in __of_add_property_sysfs()
87 void __of_sysfs_remove_bin_file(struct device_node *np, struct property *prop) in __of_sysfs_remove_bin_file() argument
92 sysfs_remove_bin_file(&np->kobj, &prop->attr); in __of_sysfs_remove_bin_file()
96 void __of_remove_property_sysfs(struct device_node *np, struct property *prop) in __of_remove_property_sysfs() argument
99 if (of_kset && of_node_is_attached(np)) in __of_remove_property_sysfs()
100 __of_sysfs_remove_bin_file(np, prop); in __of_remove_property_sysfs()
103 void __of_update_property_sysfs(struct device_node *np, struct property *newprop, in __of_update_property_sysfs() argument
111 __of_sysfs_remove_bin_file(np, oldprop); in __of_update_property_sysfs()
112 __of_add_property_sysfs(np, newprop); in __of_update_property_sysfs()
115 int __of_attach_node_sysfs(struct device_node *np) in __of_attach_node_sysfs() argument
125 np->kobj.kset = of_kset; in __of_attach_node_sysfs()
126 if (!np->parent) { in __of_attach_node_sysfs()
131 name = safe_name(&np->parent->kobj, kbasename(np->full_name)); in __of_attach_node_sysfs()
132 parent = &np->parent->kobj; in __of_attach_node_sysfs()
137 rc = kobject_add(&np->kobj, parent, "%s", name); in __of_attach_node_sysfs()
142 for_each_property_of_node(np, pp) in __of_attach_node_sysfs()
143 __of_add_property_sysfs(np, pp); in __of_attach_node_sysfs()
145 of_node_get(np); in __of_attach_node_sysfs()
149 void __of_detach_node_sysfs(struct device_node *np) in __of_detach_node_sysfs() argument
153 BUG_ON(!of_node_is_initialized(np)); in __of_detach_node_sysfs()
158 if (of_node_is_attached(np)) { in __of_detach_node_sysfs()
159 for_each_property_of_node(np, pp) in __of_detach_node_sysfs()
160 __of_sysfs_remove_bin_file(np, pp); in __of_detach_node_sysfs()
161 kobject_del(&np->kobj); in __of_detach_node_sysfs()
164 of_node_put(np); in __of_detach_node_sysfs()