of_platform_populate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– of_platform_populate πŸ’–

okay so bestie, welcome to the Kernel API Manual page for of_platform_populate(9) β€” yes that's the whole title, we're literally starting with the name, slay ✨

🌸 NAME 🌸

of_platform_populate β€” the function that goes and Populates platform_devices out of your device tree data πŸ¦‹ (yes that's the verb, "Populate", capital P energy, she's main character)

⭐ SYNOPSIS ⭐

int of_platform_populate (struct device_node *root , const struct
       of_device_id *matches , const struct of_dev_auxdata *lookup , struct
       device *parent );

four args, one int back, no cap πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • root β€” parent of the first level to probe. pass NULL and she just uses the root of the tree, easy ✨
  • matches β€” the match table. NULL means "use the default", iykyk
  • lookup β€” the auxdata table, for matching id and platform_data with device nodes 🫢
  • parent β€” the parent to hook devices from. NULL for toplevel, we love a toplevel moment

πŸ”₯ DESCRIPTION πŸ”₯

So she's similar to of_platform_bus_probe β€” same vibe, she walks the device tree and creates devices from nodes 🌈. But here's where they differ, and it's kind of a big deal:

<div></div>

She follows the modern convention of requiring all device nodes to have a 'compatible' property. Like, everyone needs one, periodt πŸ’… And she's suitable for creating devices which are children of the root node β€” meanwhile of_platform_bus_probe will only create children of the root which are selected by the matches argument πŸ™ˆ

<div></div>

πŸ’€ Friendly PSA from me to you: new board support should be using this function instead of of_platform_bus_probe. Like, don't show up to the function call with the old one, bestie, that's not the move 😭

πŸ‘‘ RETURN πŸ‘‘

0 on success πŸ’–, < 0 on failure 😭 β€” that's it, that's the whole return section, iconic and brief

🧚 SEE ALSO 🧚

Kernel file ./drivers/of/platform.c β€” plus her whole friend group:


aaand that's the page 🌸 file credits time, cutely: this one lives in ./drivers/of, dated October 2026, and it's the of_platform_populate(9) page β€” go populate some devices, bestie, you're gonna ate πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from