summaryrefslogtreecommitdiff
path: root/rust/kernel/pci/irq.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/kernel/pci/irq.rs')
-rw-r--r--rust/kernel/pci/irq.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/rust/kernel/pci/irq.rs b/rust/kernel/pci/irq.rs
index 782a524fe11c..03f2de559a8a 100644
--- a/rust/kernel/pci/irq.rs
+++ b/rust/kernel/pci/irq.rs
@@ -175,10 +175,12 @@ impl Device<device::Bound> {
flags: irq::Flags,
name: &'static CStr,
handler: impl PinInit<T, Error> + 'a,
- ) -> Result<impl PinInit<irq::Registration<T>, Error> + 'a> {
- let request = vector.try_into()?;
+ ) -> impl PinInit<irq::Registration<T>, Error> + 'a {
+ pin_init::pin_init_scope(move || {
+ let request = vector.try_into()?;
- Ok(irq::Registration::<T>::new(request, flags, name, handler))
+ Ok(irq::Registration::<T>::new(request, flags, name, handler))
+ })
}
/// Returns a [`kernel::irq::ThreadedRegistration`] for the given IRQ vector.
@@ -188,12 +190,14 @@ impl Device<device::Bound> {
flags: irq::Flags,
name: &'static CStr,
handler: impl PinInit<T, Error> + 'a,
- ) -> Result<impl PinInit<irq::ThreadedRegistration<T>, Error> + 'a> {
- let request = vector.try_into()?;
-
- Ok(irq::ThreadedRegistration::<T>::new(
- request, flags, name, handler,
- ))
+ ) -> impl PinInit<irq::ThreadedRegistration<T>, Error> + 'a {
+ pin_init::pin_init_scope(move || {
+ let request = vector.try_into()?;
+
+ Ok(irq::ThreadedRegistration::<T>::new(
+ request, flags, name, handler,
+ ))
+ })
}
/// Allocate IRQ vectors for this PCI device with automatic cleanup.