platform_dev...ode_from_dev(9)
π platform_dev...ode_from_dev(9) β a Kernel API Manual moment β¨
okay so bestie, welcome to platform_dev...ode_from_dev(9) from the Kernel API Manual β yes the title is literally abbreviated with dots, that's just how it's filed, we don't ask questions, we stan anyway π
β¨ NAME β¨
platform_device_set_of_node_from_dev β reuse the OF node of another device, no cap π¦
πΈ SYNOPSIS πΈ
void platform_device_set_of_node_from_dev (struct platform_device *pdev
, const struct device *dev2 );
π ARGUMENTS π
pdevβ the platform device you're setting the node for, she's the main character here πdev2β the device whose OF node you're reusing, borrowing her fit, iconic behaviour π
π DESCRIPTION π
So what this does is it reuses the OF node of another device inside this platform device, and internally it keeps track of the reference counting the whole time β like, it's literally doing the bookkeeping for you, no notes π«Ά
β οΈ major vibe check: this function must not be called for a platform device that already has a software node assigned as its primary firmware node. justβ¦ don't. fr fr π
π SEE ALSO π
Kernel file ./drivers/base/platform.c and the whole friend group:
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_resources(9)platform_device_add_data(9)platform_device_set_of_node(9)platform_device_set_fwnode(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, bestie π§π it comes to us from ./drivers/base, dated October 2026, and it's filed under that same platform_dev...ode_from_dev(9) name at the top and the bottom, which is giving bookends, honestly π
β¨ go set some nodes, periodt π₯
π¦ 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