Lines Matching +full:a +full:- +full:child +full:- +full:node +full:- +full:property
23 static phandle __prom_getchild(phandle node) in __prom_getchild() argument
29 cnode = prom_nodeops->no_child(node); in __prom_getchild()
36 /* Return the child of node 'node' or zero if no this node has no
39 phandle prom_getchild(phandle node) in prom_getchild() argument
43 if ((s32)node == -1) in prom_getchild()
46 cnode = __prom_getchild(node); in prom_getchild()
47 if (cnode == 0 || (s32)cnode == -1) in prom_getchild()
55 static phandle __prom_getsibling(phandle node) in __prom_getsibling() argument
61 cnode = prom_nodeops->no_nextnode(node); in __prom_getsibling()
68 /* Return the next sibling of node 'node' or zero if no more siblings
71 phandle prom_getsibling(phandle node) in prom_getsibling() argument
75 if ((s32)node == -1) in prom_getsibling()
78 sibnode = __prom_getsibling(node); in prom_getsibling()
79 if (sibnode == 0 || (s32)sibnode == -1) in prom_getsibling()
86 /* Return the length in bytes of property 'prop' at node 'node'.
87 * Return -1 on error.
89 int prom_getproplen(phandle node, const char *prop) in prom_getproplen() argument
94 if((!node) || (!prop)) in prom_getproplen()
95 return -1; in prom_getproplen()
98 ret = prom_nodeops->no_proplen(node, prop); in prom_getproplen()
105 /* Acquire a property 'prop' at node 'node' and place it in
106 * 'buffer' which has a size of 'bufsize'. If the acquisition
107 * was successful the length will be returned, else -1 is returned.
109 int prom_getproperty(phandle node, const char *prop, char *buffer, int bufsize) in prom_getproperty() argument
114 plen = prom_getproplen(node, prop); in prom_getproperty()
115 if((plen > bufsize) || (plen == 0) || (plen == -1)) in prom_getproperty()
116 return -1; in prom_getproperty()
119 ret = prom_nodeops->no_getprop(node, prop, buffer); in prom_getproperty()
126 /* Acquire an integer property and return its value. Returns -1
129 int prom_getint(phandle node, char *prop) in prom_getint() argument
133 if(prom_getproperty(node, prop, (char *) &intprop, sizeof(int)) != -1) in prom_getint()
136 return -1; in prom_getint()
140 /* Acquire an integer property, upon error return the passed default
143 int prom_getintdefault(phandle node, char *property, int deflt) in prom_getintdefault() argument
147 retval = prom_getint(node, property); in prom_getintdefault()
148 if(retval == -1) return deflt; in prom_getintdefault()
154 /* Acquire a boolean property, 1=TRUE 0=FALSE. */
155 int prom_getbool(phandle node, char *prop) in prom_getbool() argument
159 retval = prom_getproplen(node, prop); in prom_getbool()
160 if(retval == -1) return 0; in prom_getbool()
165 /* Acquire a property whose value is a string, returns a null
169 void prom_getstring(phandle node, char *prop, char *user_buf, int ubuf_size) in prom_getstring() argument
173 len = prom_getproperty(node, prop, user_buf, ubuf_size); in prom_getstring()
174 if(len != -1) return; in prom_getstring()
180 /* Search siblings at 'node_start' for a node with name
181 * 'nodename'. Return node if successful, zero if not.
194 if(error == -1) continue; in prom_searchsiblings()
203 static char *__prom_nextprop(phandle node, char * oprop) in __prom_nextprop() argument
209 prop = prom_nodeops->no_nextprop(node, oprop); in __prom_nextprop()
216 /* Return the property type string after property type 'oprop'
217 * at node 'node' . Returns empty string if no more
218 * property types for this node.
220 char *prom_nextprop(phandle node, char *oprop, char *buffer) in prom_nextprop() argument
222 if (node == 0 || (s32)node == -1) in prom_nextprop()
225 return __prom_nextprop(node, oprop); in prom_nextprop()
233 phandle node = prom_root_node, node2; in prom_finddevice() local
238 if (!*s) return node; /* path '.../' is legal */ in prom_finddevice()
239 node = prom_getchild(node); in prom_finddevice()
245 node = prom_searchsiblings(node, nbuf); in prom_finddevice()
246 if (!node) in prom_finddevice()
255 node2 = node; in prom_finddevice()
256 while (node2 && (s32)node2 != -1) { in prom_finddevice()
259 node = node2; in prom_finddevice()
264 if (!node2 || (s32)node2 == -1) in prom_finddevice()
273 return node; in prom_finddevice()
277 /* Set property 'pname' at node 'node' to value 'value' which has a length
280 int prom_setprop(phandle node, const char *pname, char *value, int size) in prom_setprop() argument
290 ret = prom_nodeops->no_setprop(node, pname, value, size); in prom_setprop()
299 phandle node; in prom_inst2pkg() local
303 node = (*romvec->pv_v2devops.v2_inst2pkg)(inst); in prom_inst2pkg()
306 if ((s32)node == -1) in prom_inst2pkg()
308 return node; in prom_inst2pkg()