Re: [PATCH] rust: irq: add support for request_irq()

From: Daniel Almeida
Date: Mon Nov 04 2024 - 14:20:07 EST


Hi Alice,


> On 29 Oct 2024, at 08:59, Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> On Thu, Oct 24, 2024 at 4:20 PM Daniel Almeida
> <daniel.almeida@xxxxxxxxxxxxx> wrote:
>>
>> Both regular and threaded versions are supported.
>>
>> Signed-off-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
>
> Why implement request_irq over devm_request_irq?
>
> Alice
>

As we spoke earlier, and for the record, devm will automate the
lifetime of a resource, taking care to relinquish it when the driver
is unloaded.

I feel better with an explicit `Drop` implementation, which is why
the devm versions were not chosen. IMHO, the problem it was
designed to solve often simply does not apply to Rust code.

— Daniel