diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs index 40c1f549b0ba..f08583fa39c9 100644 --- a/rust/kernel/device.rs +++ b/rust/kernel/device.rs @@ -68,6 +68,7 @@ pub(crate) fn as_raw(&self) -> *mut bindings::device { } /// Returns a reference to the parent device, if any. + #[cfg_attr(not(CONFIG_AUXILIARY_BUS), expect(dead_code))] pub(crate) fn parent(&self) -> Option<&Self> { // SAFETY: // - By the type invariant `self.as_raw()` is always valid.