rust/kernel/drm/device.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
The invariant documentation incorrectly referenced `struct device`
instead of `struct drm_device`. Fix it.
Fixes: 1e4b8896c0f3c ("rust: drm: add device abstraction")
Cc: stable@vger.kernel.org
Signed-off-by: Hsiu Che Yu <yu.whisper.personal@gmail.com>
---
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@gmail.com>
On Wed, Apr 29, 2026 at 01:08:14PM +0800, Hsiu Che Yu wrote:
> The invariant documentation incorrectly referenced `struct device`
> instead of `struct drm_device`. Fix it.
>
> Fixes: 1e4b8896c0f3c ("rust: drm: add device abstraction")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hsiu Che Yu <yu.whisper.personal@gmail.com>
LGTM
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
© 2016 - 2026 Red Hat, Inc.