[patch] Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list

Stanislav Galabov sgalabov at gmail.com
Sat Jan 23 06:34:17 UTC 2016


Hi all,

I’ve just opened the following PR:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206516

The patch, attached to the PR, basically suggests a way to obtain the length of the list parsed by ofw_bus_parse_xref_list_alloc in advance (e.g., without having to iterate until we get an error or a NULL result). This would be useful in cases where we don’t know what the length of the list would be, but we need to get all its parsed entries and store a reference to them somewhere (e.g., a device’s softc).

This would be useful in particular for my Ralink/Mediatek MIPS work, since there are, for example, chips in this family, that need to enable/disable 2 clocks for USB and then there are others that only need 1. The same goes for resets.

Best wishes,
Stanislav


More information about the freebsd-arm mailing list