On 11/26/26 12:45, Danilo Krummrich wrote:
> On Mon Nov 23, 2026 at 3:58 PM CET, Laura Nao wrote:
>> +/// Requests a threaded IRQ registration for the Job IRQ.
>> +///
>> +/// # Safety
>> +///
>> +/// Callers must not `mem::forget()` the resulting registration or 
>> otherwise prevent its
>> +/// [`Drop`] implementation from running.
>> +pub(crate) unsafe fn job_irq_init<'a>(
>> +    pdev: &'a platform::Device<Bound>,
>> +    hw: Arc<HwGate<'a>>,
>> +    events: Arc<JobIrqEvents>,
>> +) -> Result<Pin<KBox<TyrIrqRegistration<'a, JobIrq>>>> {
>> +    let job_irq = JobIrq { events };
>> +    // Ensure interrupt sources are disabled until the handler is 
>> registered.
>> +    job_irq.clear_mask(hw.access().iomem());
>> +
>> +    // SAFETY: The caller guarantees the resulting registration will not be 
>> leaked.
>> +    unsafe { TyrIrqRegistration::request(pdev, c"job", job_irq, hw) }
>> +}
>
> You could implement a constructor in an impl TyrIrqRegistration<'a, JobIrq>
> block instead, which is think is cleaner than a free standing function.

Right, thanks for the suggestion. Will do.

Best,
Laura

Reply via email to