Re: [PATCH 05/20] bootwrapper: flatdevtree fixes
From: Scott Wood <hidden>
Date: 2007-08-24 14:48:46
On Fri, Aug 24, 2007 at 11:01:22AM +1000, David Gibson wrote:
On Thu, Aug 23, 2007 at 12:48:30PM -0500, Scott Wood wrote:quoted
It's likely to be ugly no matter what, though I'll try to come up with something slightly nicer. If I were doing this code from scratch, I'd probably liven the tree first and reflatten it to pass to the kernel.Eh, probably not worth bothering doing an actual implementation at this stage - I'll have to redo it for libfdt anyway.
Too late, I already wrote it -- it wasn't as bad as I thought it would be.
flatdevtree uses some of the information it caches in the phandle context stuff to remember who's the parent of a node. libfdt uses raw offsets into the structure, so the *only* way to implement get_parent() is to rescan the dt from the beginning, keeping track of parents until reaching the given node.
What is the benefit of doing it that way? -Scott