platform_dev...ode_from_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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