Skip to content

Commit

Permalink
refactor(fdt): move chosen creation to finish
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Nov 16, 2024
1 parent 7b0287a commit 613e90a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ impl Fdt {
writer.property_u32("#address-cells", 0x2)?;
writer.property_u32("#size-cells", 0x2)?;

let chosen_node = writer.begin_node("chosen")?;
writer.end_node(chosen_node)?;

Ok(Self { writer, root_node })
}

pub fn finish(mut self) -> FdtWriterResult<Vec<u8>> {
let chosen_node = self.writer.begin_node("chosen")?;
self.writer.end_node(chosen_node)?;

self.writer.end_node(self.root_node)?;

self.writer.finish()
Expand Down

0 comments on commit 613e90a

Please sign in to comment.