Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135408138
D5043.id12627.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
956 B
Referenced Files
None
Subscribers
None
D5043.id12627.diff
View Options
Index: sys/dev/ofw/ofw_bus_subr.c
===================================================================
--- sys/dev/ofw/ofw_bus_subr.c
+++ sys/dev/ofw/ofw_bus_subr.c
@@ -629,6 +629,8 @@
* node - consumers device node
* list_name - name of parsed list - "clocks"
* cells_name - name of size property - "#clock-cells"
+ * idx - the index of the requested list entry, or, if -1, an indication
+ * to return the number of entries in the parsed list.
* Output arguments:
* producer - handle of producer
* ncells - number of cells in result
@@ -649,7 +651,7 @@
(void **)&elems);
if (nelems <= 0)
return (ENOENT);
- rv = ENOENT;
+ rv = (idx == -1) ? 0 : ENOENT;
for (i = 0, cnt = 0; i < nelems; i += pcells, cnt++) {
pnode = elems[i++];
if (OF_getencprop(OF_node_from_xref(pnode),
@@ -678,6 +680,8 @@
}
if (elems != NULL)
free(elems, M_OFWPROP);
+ if (idx == -1 && rv == 0)
+ return (cnt);
return (rv);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 10, 2:28 PM (12 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25110558
Default Alt Text
D5043.id12627.diff (956 B)
Attached To
Mode
D5043: Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list
Attached
Detach File
Event Timeline
Log In to Comment