Skip to content

Commit 258a6b5

Browse files
hoshinolinamarcan
authored andcommitted
rust: drm: device: Convert Device to AlwaysRefCounted
Switch from being a refcount wrapper itself to a transparent wrapper around `bindings::drm_device`. The refcounted type then becomes ARef<Device<T>>. Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent cf6f772 commit 258a6b5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rust/kernel/drm/file.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ pub(super) unsafe extern "C" fn open_callback<T: DriverFile>(
3232
raw_dev: *mut bindings::drm_device,
3333
raw_file: *mut bindings::drm_file,
3434
) -> core::ffi::c_int {
35-
let drm = core::mem::ManuallyDrop::new(unsafe { drm::device::Device::from_raw(raw_dev) });
35+
let drm = unsafe { drm::device::Device::borrow(raw_dev) };
3636
// SAFETY: This reference won't escape this function
3737
let file = unsafe { &mut *raw_file };
3838

39-
let inner = match T::open(&drm) {
39+
let inner = match T::open(drm) {
4040
Err(e) => {
4141
return e.to_errno();
4242
}

0 commit comments

Comments
 (0)