The return value of `Device::parent` method was defaulting to `Normal`
context, instead of having the same context as `self`.

Signed-off-by: Manos Pitsidianakis <[email protected]>
---
 rust/kernel/device.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index 
94e0548e76871d8b7de309c1f1c7b77bb49738ed..07d2f1225cd87f4fc091a5d6cb626726ae175894
 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -341,7 +341,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<&Device> {
+    pub(crate) fn parent(&self) -> Option<&Device<Ctx>> {
         // SAFETY:
         // - By the type invariant `self.as_raw()` is always valid.
         // - The parent device is only ever set at device creation.

-- 
2.47.3


Reply via email to