Re: [PATCH v6 3/6] rust: irq: add support for non-threaded IRQs and handlers

Danilo Krummrich
2025-07-08T12:19:42Z

On 7/8/25 2:15 PM, Dirk Behme wrote:
> For example for Resource the elements size, start, name and flags are
> accessible. Inspired by that, what do you think about exposing the irq
> number here, as well?
>
> diff --git a/rust/kernel/irq/request.rs b/rust/kernel/irq/request.rs
> index bd489b8d2386..767d66e3e6c7 100644
> --- a/rust/kernel/irq/request.rs
> +++ b/rust/kernel/irq/request.rs
> @@ -123,6 +123,11 @@ impl<'a> IrqRequest<'a> {
> pub(crate) unsafe fn new(dev: &'a Device<Bound>, irq: u32) -> Self {
> IrqRequest { dev, irq }
> }
> +
> + /// Returns the IRQ number of an [`IrqRequest`].
> + pub fn irq(&self) -> u32 {
> + self.irq
> + }
> }
>
>
> I'm using that for some dev_info!().

Not sure that's a reasonable candidate for dev_info!() prints, but maybe it can
be useful for some debug prints.