Page MenuHomeFreeBSD

ofw_fdt: Simplify with libfdt methods
ClosedPublic

Authored by kevans on Feb 6 2018, 2:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 22, 3:10 AM
Unknown Object (File)
Sat, Nov 15, 1:40 AM
Unknown Object (File)
Sat, Nov 15, 12:37 AM
Unknown Object (File)
Sat, Nov 1, 3:24 AM
Unknown Object (File)
Wed, Oct 29, 1:21 PM
Unknown Object (File)
Oct 22 2025, 4:29 AM
Unknown Object (File)
Aug 4 2025, 4:44 AM
Unknown Object (File)
Jul 27 2025, 8:37 AM
Subscribers

Details

Summary

libfdt now provides methods to iterate through subnodes and properties in a convenient fashion.

Replace our ofw_fdt_{peer,child} searches with calls to their corresponding libfdt methods. Rework ofw_fdt_nextprop to use the fdt_for_each_property_offset macro, making it even more obvious what it's doing.

Side note: I'm not completely sold on how I reworked ofw_fdt_nextprop, but it does read a little easier to me this way. I also think we should probably revise the comment about its return values above since 0 will actually indicate 'no more properties or previous property does not exist' and -1 will indicate 'package does not exist or internal error' -- I consider that out of scope for these changes, though.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 24 2018, 10:12 PM
This revision was automatically updated to reflect the committed changes.