platform_device_set_of_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… platform_device_set_of_node πŸ’…

okay bestie, welcome to the Kernel API Manual page for platform_device_set_of_node. we're folding the manual name in right here at the top instead of doing a boring copy-paste header, and honestly? iconic. πŸŽ€


🌸 NAME 🌸

platform_device_set_of_node β€” the function that assigns an OF node to a device πŸ¦‹


✨ SYNOPSIS ✨

void platform_device_set_of_node (struct platform_device *pdev , struct device_node *np );

πŸ’– ARGUMENTS πŸ’–

  • pdev β€” the platform device you're adding the node for 🫢
  • np β€” the new device node ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this one assigns an OF node to this platform device. internally it keeps track of the reference count β€” no cap, that tracking is part of the vibe. πŸ”₯

big important bestie note: devices created with platform_device_alloc must use this function instead of assigning the node manually. don't try to DIY it, okay? πŸ’…

🚨 and this function must not be called for a platform device that already has a software node as its primary firmware node assigned. that's the hard no. periodt.

🌈 SEE ALSO 🌈

kernel file ./drivers/base/platform.c β€” and all these friends:


kisses bestie, this page is from ./drivers/base, dated October 2026, for platform_device_set_of_node(9) πŸ’–

πŸ“¦ where this page comes from