libfdt: Change FdtNodeMut::add_subnode*(self, ...)
As the borrow checker forbids having more than one mutable reference at
the same time and as FdtNodeMut is a wrapper around &mut Fdt, take the
ownership of the node when obtaining its first_subnode, allowing less
convoluted code when walking a mutable DT.
Bug: 324046698
Test: m pvmfw virtmgr fsfdt librialto libfdtpci
Test: m liblibfdt.integration_test libpvmfw.device_assignment.test
Change-Id: I1bbbebe263c21f95b3637bb6266b4308079ada8f
diff --git a/vmbase/example/src/main.rs b/vmbase/example/src/main.rs
index 6f513ee..48b24be 100644
--- a/vmbase/example/src/main.rs
+++ b/vmbase/example/src/main.rs
@@ -181,7 +181,7 @@
info!("FDT successfully unpacked.");
let path = cstr!("/memory");
- let mut node = writer.node_mut(path).unwrap().unwrap();
+ let node = writer.node_mut(path).unwrap().unwrap();
let name = cstr!("child");
let mut child = node.add_subnode(name).unwrap();
info!("Created subnode '{}/{}'.", path.to_str().unwrap(), name.to_str().unwrap());