Skip to content

Commit 54f0910

Browse files
committed
zephyr-core: kobj: helper for getting the real obj from a static wrapper
1 parent 36a8b5f commit 54f0910

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/zephyr-core/src/kobj.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ macro_rules! make_static_wrapper {
7171
pub const unsafe fn uninit() -> Self {
7272
$k_type(StaticKObj::uninit())
7373
}
74+
75+
/// Get the real k_obj type. Same as deref twice.
76+
pub fn kobj(&self) -> &$k_path {
77+
self.deref().deref()
78+
}
7479
}
7580

7681
impl Deref for $k_type {

0 commit comments

Comments
 (0)