pub fn register_handler(&mut self, irq_num: usize, handler: IrqHandler) -> DeviceResult<usize> {
        info!("IRQ register handler {:#x}", irq_num);
        let irq_num = if irq_num == 0 {
            // allocate a valid IRQ number
            self.allocator.alloc()?
        } else if self.irq_range.contains(&irq_num) {
            self.allocator.alloc_fixed(irq_num)?;
            irq_num
        } else {
            return Err(DeviceError::InvalidParam);
        };
        self.table[irq_num] = Some(handler);
        Ok(irq_num)
    }
/// Add a handler to IRQ table. if `irq_num == 0`, we need to allocate one.
/// Returns the specified IRQ number or an allocated IRQ on success.
Add a handler to IRQ table. if `irq_num == 0`, we need to allocate one.
Returns the specified IRQ number or an allocated IRQ on success.
Add a handler to IRQ table . if ` irq_num == 0 ` we need to allocate one . Returns the specified IRQ number or an allocated IRQ on success .
pub fn register_handler(&mut self, irq_num: usize, handler: IrqHandler) -> DeviceResult<usize> {
        info!("IRQ register handler {:#x}", irq_num);
        let irq_num = if irq_num == 0 {
            // allocate a valid IRQ number
            self.allocator.alloc()?
        } else if self.irq_range.contains(&irq_num) {
            self.allocator.alloc_fixed(irq_num)?;
            irq_num
        } else {
            return Err(DeviceError::InvalidParam);
        };
        self.table[irq_num] = Some(handler);
        Ok(irq_num)
    }
pub fn register_handler ( & mut self , irq_num : usize , handler : IrqHandler ) -> DeviceResult < usize > { info ! ( " " irq_num ) ; let irq_num = if irq_num == 0 { // allocate a valid IRQ number self . allocator . alloc ( ) ? } else if self . irq_range . contains ( & irq_num ) { self . allocator . alloc_fixed ( irq_num ) ? ; irq_num } else { return Err ( DeviceError :: InvalidParam ) ; } ; self . table [ irq_num ] = Some ( handler ) ; Ok ( irq_num ) }
Add a handler to IRQ table.
Add a handler to IRQ table .
&mut self
irq_num
usize
handler
IrqHandler
&mut self
irq_num
usize
handler
IrqHandler