diff --git a/src/fdt/node.rs b/src/fdt/node.rs
index b703493..3ff64ce 100644
--- a/src/fdt/node.rs
+++ b/src/fdt/node.rs
@@ -58,6 +58,10 @@ impl<'a> Node<'a> for FdtNode<'a> {
parent_address_space: self.address_space(),
}
}
+
+ fn parent_address_space(self) -> AddressSpaceProperties {
+ self.parent_address_space
+ }
}
impl<'a> FdtNode<'a> {
diff --git a/src/lib.rs b/src/lib.rs
index e40cea3..62203cb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -139,6 +139,7 @@ use core::ops::{BitOr, Shl};
use zerocopy::big_endian;
use crate::error::{PropertyError, StandardError};
+use crate::standard::AddressSpaceProperties;
pub use crate::values::{
FdtStringListIterator, FromPropertyValue, PropEncodedArrayIterator, ToPropertyValue,
};
@@ -244,6 +245,11 @@ pub trait Node<'a>: Copy {
/// assert!(children.next().is_none());
/// ```
fn children(self) -> Self::Children;
+
+ /// Returns the `#address-cells` and `#size-cells` properties of this
+ /// node's parent node.
+ #[must_use]
+ fn parent_address_space(self) -> AddressSpaceProperties;
}
/// A property of a device tree node.
diff --git a/src/model/node.rs b/src/model/node.rs
index 3016f77..c727f7c 100644
--- a/src/model/node.rs
+++ b/src/model/node.rs
@@ -118,6 +118,10 @@ impl<'a> Node<'a> for DeviceTreeNodeRef<'a> {
parent_address_space: self.address_space(),
}
}
+
+ fn parent_address_space(self) -> AddressSpaceProperties {
+ self.parent_address_space
+ }
}
mod private {
diff --git a/src/standard.rs b/src/standard.rs
index 66f58d2..f838c6e 100644
--- a/src/standard.rs
+++ b/src/standard.rs
@@ -22,7 +22,6 @@ pub use self::ranges::Range;
pub use self::reg::Reg;
pub use self::status::Status;
use crate::error::{PropertyError, StandardError};
-use crate::fdt::FdtNode;
use crate::{Node, Property};
pub(crate) const DEFAULT_ADDRESS_CELLS: u32 = 2;
@@ -157,20 +156,17 @@ pub trait NodeStandard<'a>: Node<'a> {
fn dma_coherent(self) -> bool {
self.property("dma-coherent").is_some()
}
-}
-
-impl<'a, T: Node<'a>> NodeStandard<'a> for T {}
-impl<'a> FdtNode<'a> {
/// Returns the value of the standard `reg` property.
///
/// # Errors
///
/// Returns an error if the size of the value isn't a multiple of the
/// expected number of address and size cells.
- pub fn reg(self) -> Result