Skip to content

Commit 3d96fd9

Browse files
committed
fixup! rust: drm: Add Device and Driver abstractions
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 8b6329a commit 3d96fd9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

rust/kernel/drm/drv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! C header: [`include/drm/drm_drv.h`](../../../../include/drm/drm_drv.h)
66
77
use crate::{
8+
alloc::{box_ext::BoxExt, flags::*},
89
bindings, device, drm,
910
error::code::*,
1011
error::from_err_ptr,
@@ -240,7 +241,7 @@ impl<T: Driver> Registration<T> {
240241
///
241242
/// It is allowed to move.
242243
pub fn new(parent: &dyn device::RawDevice) -> Result<Self> {
243-
let vtable = Pin::new(Box::try_new(Self::VTABLE)?);
244+
let vtable = Pin::new(Box::new(Self::VTABLE, GFP_KERNEL)?);
244245
// SAFETY: Safe to call at any time (with valid args)
245246
let raw_drm = unsafe { bindings::drm_dev_alloc(&*vtable, parent.raw_device()) };
246247
let raw_drm = NonNull::new(from_err_ptr(raw_drm)? as *mut _).ok_or(ENOMEM)?;

0 commit comments

Comments
 (0)