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)
Tue, Apr 2, 1:55 PM
Unknown Object (File)
Feb 24 2024, 8:06 PM
Unknown Object (File)
Dec 20 2023, 4:06 AM
Unknown Object (File)
Nov 13 2023, 10:27 PM
Unknown Object (File)
Oct 27 2023, 12:15 PM
Unknown Object (File)
Oct 25 2023, 4:10 AM
Unknown Object (File)
Sep 17 2023, 3:14 PM
Unknown Object (File)
Jul 11 2023, 9:04 PM
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.