FreeBSD Bugzilla – Attachment 165990 Details for
Bug 206516
[patch] Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list
ofw_bus_parse_xref_list_alloc.patch (text/plain), 1.13 KB, created by
Stanislav Galabov
on 2016-01-23 06:28:24 UTC
(
hide
)
Description:
Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list
Filename:
MIME Type:
Creator:
Stanislav Galabov
Created:
2016-01-23 06:28:24 UTC
Size:
1.13 KB
patch
obsolete
>diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c >index 60a341c..15cafa6 100644 >--- a/sys/dev/ofw/ofw_bus_subr.c >+++ b/sys/dev/ofw/ofw_bus_subr.c >@@ -629,6 +629,8 @@ ofw_bus_find_child_device_by_phandle(device_t bus, phandle_t node) > * 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 @@ ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name, > (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 @@ ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name, > } > if (elems != NULL) > free(elems, M_OFWPROP); >+ if (idx == -1 && rv == 0) >+ return (cnt); > return (rv); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 206516
: 165990