summaryrefslogtreecommitdiff
path: root/rust/kernel/drm/device.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/kernel/drm/device.rs')
-rw-r--r--rust/kernel/drm/device.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/rust/kernel/drm/device.rs b/rust/kernel/drm/device.rs
index 74c9a3dd719e..624d7a4c83ea 100644
--- a/rust/kernel/drm/device.rs
+++ b/rust/kernel/drm/device.rs
@@ -135,6 +135,8 @@ impl<T: drm::Driver> Device<T> {
///
/// `ptr` must be a valid pointer to a `struct device` embedded in `Self`.
unsafe fn from_drm_device(ptr: *const bindings::drm_device) -> *mut Self {
+ let ptr: *const Opaque<bindings::drm_device> = ptr.cast();
+
// SAFETY: By the safety requirements of this function `ptr` is a valid pointer to a
// `struct drm_device` embedded in `Self`.
unsafe { crate::container_of!(ptr, Self, dev) }.cast_mut()