[PATCH] rust: drm: fix incorrect type name in `Device` doc comment
From: Hsiu Che Yu
Date: Wed Apr 29 2026 - 01:09:01 EST
The invariant documentation incorrectly referenced `struct device`
instead of `struct drm_device`. Fix it.
Fixes: 1e4b8896c0f3c ("rust: drm: add device abstraction")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Hsiu Che Yu <yu.whisper.personal@xxxxxxxxx>
---
rust/kernel/drm/device.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rust/kernel/drm/device.rs b/rust/kernel/drm/device.rs
index adbafe8db54d..301c9f7859e2 100644
--- a/rust/kernel/drm/device.rs
+++ b/rust/kernel/drm/device.rs
@@ -72,7 +72,7 @@ macro_rules! drm_legacy_fields {
///
/// # Invariants
///
-/// `self.dev` is a valid instance of a `struct device`.
+/// `self.dev` is a valid instance of a `struct drm_device`.
#[repr(C)]
pub struct Device<T: drm::Driver> {
dev: Opaque<bindings::drm_device>,
@@ -160,7 +160,7 @@ pub(crate) fn as_raw(&self) -> *mut bindings::drm_device {
/// # Safety
///
- /// `ptr` must be a valid pointer to a `struct device` embedded in `Self`.
+ /// `ptr` must be a valid pointer to a `struct drm_device` embedded in `Self`.
unsafe fn from_drm_device(ptr: *const bindings::drm_device) -> *mut Self {
// SAFETY: By the safety requirements of this function `ptr` is a valid pointer to a
// `struct drm_device` embedded in `Self`.
@@ -184,7 +184,7 @@ unsafe fn into_drm_device(ptr: NonNull<Self>) -> *mut bindings::drm_device {
/// to can't drop to zero, for the duration of this function call and the entire duration when
/// the returned reference exists.
///
- /// Additionally, callers must ensure that the `struct device`, `ptr` is pointing to, is
+ /// Additionally, callers must ensure that the `struct drm_device`, `ptr` is pointing to, is
/// embedded in `Self`.
#[doc(hidden)]
pub unsafe fn from_raw<'a>(ptr: *const bindings::drm_device) -> &'a Self {
---
base-commit: b4e07588e743c989499ca24d49e752c074924a9a
change-id: 20260429-fix-drm-device-comment-41859883dcfb
Best regards,
--
Hsiu Che Yu <yu.whisper.personal@xxxxxxxxx>