platform_get_irq_affinity(9)
π 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 optionalcpumaskpointer 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:
platform_get_resource(9)devm_platform_get_and_ioremap_resource(9)devm_platform_ioremap_resource(9)devm_platform_ioremap_resource_byname(9)platform_get_irq_optional(9)platform_get_irq(9)platform_irq_count(9)devm_platform_get_irqs_affinity(9)platform_get_resource_byname(9)platform_get_irq_byname(9)platform_get_irq_byname_optional(9)platform_add_devices(9)platform_device_put(9)platform_device_alloc(9)platform_device_add_resources(9)platform_device_add_data(9)platform_device_set_of_node(9)platform_device_set_fwnode(9)platform_device_set_of_node_from_dev(9)platform_device_add(9)platform_device_del(9)platform_device_register(9)platform_device_unregister(9)platform_device_register_full(9)__platform_driver_register(9)platform_driver_unregister(9)__platform_driver_probe(9)__platform_create_bundle(9)__platform_register_drivers(9)platform_unregister_drivers(9)platform_match(9)platform_find_device_by_driver(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms