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)
Oct 22 2024, 1:44 AM
Unknown Object (File)
Oct 1 2024, 3:12 AM
Unknown Object (File)
Sep 22 2024, 12:16 PM
Unknown Object (File)
Sep 22 2024, 2:30 AM
Unknown Object (File)
Sep 8 2024, 10:00 AM
Unknown Object (File)
Sep 8 2024, 4:24 AM
Unknown Object (File)
Sep 7 2024, 6:18 PM
Unknown Object (File)
Aug 31 2024, 4:15 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.