platform_device_add_data(9)
π platform_device_add_data(9) π
okay so this one lives in the Kernel API Manual, bestie, and it's genuinely one of the more glam little helpers in drivers/base. it's giving "put my data on my device" energy and honestly? we're obsessed.
β¨ NAME β¨
platform_device_add_data β adds platform-specific data to a platform device π
π¦ SYNOPSIS π¦
int platform_device_add_data (struct platform_device *pdev , const void *data , size_t size );
like literally that's the whole signature, no cap π
πΈ ARGUMENTS πΈ
pdevβ the platform device you got fromplatform_device_alloc, and you're adding resources to it. main character device fr.dataβ the platform specific data for this platform device. your little payload πsizeβ the size of that platform specific data. gotta know how much we're working with π
π₯ DESCRIPTION π₯
so what it actually does: it adds a copy of your platform specific data onto the platform device's platform_data pointer. a copy, bestie β not your pointer, a whole fresh copy β¨
and the memory that's associated with the platform data? it gets freed automatically when the platform device is released. so you don't have to stress about cleanup, the kernel's got you π«Ά
π SEE ALSO π
okay this list is LONG but every single one of these is a baddie, so here we go:
Kernel file ./drivers/base/platform.cplatform_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_resources(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 whole page, periodt β¨ this icon was brought to you by the <bold>./drivers/base</bold> girlies, dated October 2026 β go forth and add your data, bestie, you're gonna slay π
π
π¦ 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