Skip to contentSkip to conversation

rust: drm: fix incorrect type name in `Device` doc comment

PATCH In review Hsiu Che Yu 2 participants 2 messages Apr 29

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: drm: fix incorrect type name in `Device` doc comment

The invariant documentation incorrectly referenced struct device instead of struct drm_device. Fix it.

Fixes 1e4b8896c0f3c ("rust: drm: add device abstraction")
---
 rust/kernel/drm/device.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
rust/kernel/drm/device.rs +3 -3
index adbafe8db54d..301c9f7859e2 100644
@@ -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,

Signature · 1 line
Hsiu Che Yu <[email protected]>