Skip to content

Commit 43abfca

Browse files
committed
HACK: rust: of: add as_raw()
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 576e5fb commit 43abfca

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rust/kernel/of.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ impl Node {
100100
unsafe { &*self.raw_node }
101101
}
102102

103+
/// Returns a reference to the underlying C `device_node` structure.
104+
pub fn as_raw(&self) -> *mut bindings::device_node {
105+
// SAFETY: `raw_node` is valid per the type invariant.
106+
unsafe { self.raw_node }
107+
}
108+
103109
/// Returns the name of the node.
104110
pub fn name(&self) -> &CStr {
105111
// SAFETY: The lifetime of the `CStr` is the same as the lifetime of this `Node`.

0 commit comments

Comments
 (0)