Skip to content

Commit c76057a

Browse files
committed
fixup! *RFL import: kernel::driver
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent a5e634e commit c76057a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

rust/kernel/driver.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
//! Each bus/subsystem is expected to implement [`DriverOps`], which allows drivers to register
66
//! using the [`Registration`] class.
77
8-
use crate::{error::code::*, error::Result, str::CStr, sync::Arc, ThisModule};
8+
use crate::{
9+
alloc::{box_ext::BoxExt, flags::*},
10+
error::code::*,
11+
error::Result,
12+
str::CStr,
13+
sync::Arc,
14+
ThisModule,
15+
};
916
use alloc::boxed::Box;
1017
use core::{cell::UnsafeCell, marker::PhantomData, ops::Deref, pin::Pin};
1118

@@ -66,7 +73,7 @@ impl<T: DriverOps> Registration<T> {
6673
///
6774
/// Returns a pinned heap-allocated representation of the registration.
6875
pub fn new_pinned(name: &'static CStr, module: &'static ThisModule) -> Result<Pin<Box<Self>>> {
69-
let mut reg = Pin::from(Box::try_new(Self::new())?);
76+
let mut reg = Pin::from(Box::new(Self::new(), GFP_KERNEL)?);
7077
reg.as_mut().register(name, module)?;
7178
Ok(reg)
7279
}

0 commit comments

Comments
 (0)