of_platform_populate(9)
π 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. passNULLand she just uses the root of the tree, easy β¨matchesβ the match table.NULLmeans "use the default", iykyklookupβ the auxdata table, for matchingidandplatform_datawith device nodes π«Άparentβ the parent to hook devices from.NULLfor 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:
of_find_device_by_node(9)of_device_alloc(9)of_platform_device_create_pdata(9)of_platform_device_create(9)of_platform_bus_create(9)of_platform_bus_probe(9)of_platform_depopulate(9)devm_of_platform_populate(9)devm_of_platform_depopulate(9)
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
- 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