Skip to content

Instantly share code, notes, and snippets.

@gabriserra
Created October 12, 2022 12:44
Show Gist options
  • Save gabriserra/f964dd04cc1e80686ebbe0c762568671 to your computer and use it in GitHub Desktop.
Save gabriserra/f964dd04cc1e80686ebbe0c762568671 to your computer and use it in GitHub Desktop.
Get HW IRQ number from Linux IRQ
static long long irq_to_hwirq(unsigned int irq)
{
struct irq_data *irq_data;
irq_data = irq_get_irq_data(irq);
if (irq_data == NULL)
{
pr_err("driver: unable to find irq %u descriptor.\n", irq);
return -EINVAL;
}
return irqd_to_hwirq(irq_data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment