libfdt: Make Fdt::root{,_mut}() infallible
As we now build the node without calling into libfdt, there's no need
for the Rust functions to -> Result<_> so update the API accordingly.
Test: m pvmfw virtmgr fsfdt librialto libfdtpci
Test: liblibfdt.integration_test libpvmfw.device_assignment.test
Change-Id: I82d146b0db851c72cb3d58516f4cc14fff3f0321
diff --git a/virtualizationmanager/src/dt_overlay.rs b/virtualizationmanager/src/dt_overlay.rs
index b39ba3a..108ed61 100644
--- a/virtualizationmanager/src/dt_overlay.rs
+++ b/virtualizationmanager/src/dt_overlay.rs
@@ -61,8 +61,8 @@
let fdt =
Fdt::create_empty_tree(buffer).map_err(|e| anyhow!("Failed to create empty Fdt: {e:?}"))?;
- let root = fdt.root_mut().map_err(|e| anyhow!("Failed to get root node: {e:?}"))?;
- let mut fragment = root
+ let mut fragment = fdt
+ .root_mut()
.add_subnode(cstr!("fragment@0"))
.map_err(|e| anyhow!("Failed to add fragment node: {e:?}"))?;
fragment