libfdt: Add FdtNodeMut::add_subnodes()

New API helps to add multiple subnodes at once.

Existing add_subnode() can't be used for the purpose because borrow
checker thinks that both self and the new subnode have mutable reference
of Fdt at once, even when the new node is dropped immediately.

Bug: 318431695
Test: atest liblibfdt.integration_test, TH
Change-Id: Ie490954a188362611e5175029b954536f837e283
diff --git a/libs/libfdt/src/lib.rs b/libs/libfdt/src/lib.rs
index 9782dde..8a4e251 100644
--- a/libs/libfdt/src/lib.rs
+++ b/libs/libfdt/src/lib.rs
@@ -750,6 +750,14 @@
         FdtNode { fdt: self.fdt, offset: self.offset }
     }
 
+    /// Adds new subnodes to the given node.
+    pub fn add_subnodes(&mut self, names: &[&CStr]) -> Result<()> {
+        for name in names {
+            self.add_subnode_offset(name.to_bytes())?;
+        }
+        Ok(())
+    }
+
     /// Adds a new subnode to the given node and return it as a FdtNodeMut on success.
     pub fn add_subnode(&'a mut self, name: &CStr) -> Result<Self> {
         let offset = self.add_subnode_offset(name.to_bytes())?;