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

From: Andreas Hindborg
Date: Tue Mar 04 2025 - 08:45:06 EST


"Daniel Almeida" <daniel.almeida@xxxxxxxxxxxxx> writes:

>> On 22 Jan 2025, at 13:39, Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx> wrote:
>>
>> Add support for registering IRQ handlers in Rust.

[...]

>> +/// use kernel::prelude::*;
>> +/// use kernel::irq::request::flags;
>> +/// use kernel::irq::request::Registration;
>
> By the way, I wonder if a re-export would be beneficial? I find it a bit tedious to specify this path.
>
> It also clashes with kernel::driver::Registration and kernel::driver::drm::Registration, so I find myself
> continuously writing an alias for it, i.e.:
>
> ```
> Use kernel::irq::request::Registration as IrqRegistration;
> Use kernel::irq::request::Handler as IrqHandler;
> ```
>
> Looking at mq.rs <http://mq.rs/>, I see Andreas did something similar:
>
> ```
> pub use operations::Operations;
> pub use request::Request;
> pub use tag_set::TagSet;
> ```
>
> Asking for opinions here since this is a bit cosmetic in nature. IMHO, at least the ‘request’ part of the path has to go.

For block I usually import `mq` if there can be clashes, then I can use
`mq::Request`, which is not so bad. I think a reexport to make
`irq::request::Request` available as `irq::Request` would be nice.

In `mq`, most sub modules are not pub, so the only way to reach the
types is through the reexport.


Best regards,
Andreas Hindborg