platform_get_irq_affinity(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ platform_get_irq_affinity β€” the kernel API manual, bestie edition ✨

okay so this page is platform_get_irq_affinity(9) from the Kernel API Manual, and it's genuinely one of those little functions that eats and leaves no crumbs if you use it right 🫢


🌸 NAME 🌸

platform_get_irq_affinity β€” literally just grab an optional IRQ for a device, plus its affinity πŸ’…


✨ SYNOPSIS ✨

int platform_get_irq_affinity (struct platform_device *dev , unsigned
int num , const struct cpumask **affinity );

like, that's the whole signature, no cap. write it exactly like that πŸ“


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the platform device, your main character here πŸ‘‘
  • num β€” the interrupt number index πŸ”’
  • affinity β€” an optional cpumask pointer that gets you the affinity of a per-cpu interrupt 🧚

πŸ’– DESCRIPTION πŸ’–

So the vibe is: this gets an interrupt for a platform device. simple, iconic, does what it says πŸ¦‹

bestie listen to me β€” device drivers should check the return value for errors so as to not pass a negative integer value to the request_irq APIs 😭 that's not a suggestion, that's the whole plot

Optional affinity info gets handed to you in the affinity pointer if available, and NULL otherwise. that's it, that's the deal ⭐


πŸ”₯ RETURN πŸ”₯

  • non-zero interrupt number on success β€” we love a win πŸ’œ
  • negative error number on failure β€” check for this, fr fr πŸ’€

🌈 SEE ALSO 🌈

the whole friend group, no one gets left out πŸ’• kernel file ./drivers/base/platform.c plus:


and that's the page!! mwah πŸ’‹ this one lives in ./drivers/base, dated October 2026, and it's platform_get_irq_affinity(9) β€” go forth and check your return values, queen πŸŽ€βœ¨

πŸ“¦ where this page comes from