platform_de...dd_resources(9)
π
okay so it's platform_device_add_resources o'clock π
bestie, welcome to the Kernel API Manual β yes, that one β for platform_device_add_resources. it's giving βI copy your resources so future-you doesn't get left on read.β let's go. π«Ά
πΈ NAME πΈ
platform_device_add_resources β add resources to a platform device
β¨ SYNOPSIS β¨
here's the signature, exactly, no edits bestie:
int platform_device_add_resources (struct platform_device *pdev , const
struct resource *res , unsigned int num );
π ARGUMENTS π
okay so these are the three things you're feeding it:
pdevβ the platform device allocated byplatform_device_allocthat you're adding resources to. yes, that one. πresβ the set of resources that needs to be allocated for the device. it's giving βhere's the resource bundle.β πnumβ the number of resources. literally the count. π’
π DESCRIPTION π
this function adds a copy of the resources to the platform device. not a βtrust me broβ alias situation β a copy, no cap. π
and the memory associated with the resources will be freed when the platform device is released. so the cleanup is tied to the device release, periodt. π§
π¦ SEE ALSO π¦
Kernel file ./drivers/base/platform.c is the home base, bestie. then go peek at the whole platform squad:
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_affinity(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_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)
π«Ά that's the whole page! from the Kernel API Manual, source./drivers/base, dated October 2026, filed underplatform_de...dd_resources(9). mwah π
π¦ 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