of_get_next_cpu_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so of_get_next_cpu_node β€” bestie, it's literally the "iterate on cpu nodes" function, that's the whole vibe ✨ (manual fam: Kernel API Manual πŸŽ€)


🌸 SYNOPSIS 🌸

struct device_node * of_get_next_cpu_node (struct device_node *prev );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • prev β€” the previous child of the /cpus node, or NULL if you wanna grab the very first one 🫢 (yes, passing NULL is the "start me from the top" move, no cap)

✨ DESCRIPTION ✨

so like, here's the tea β˜• β€” unusable CPUs get skipped. and by "unusable" we mean the ones whose status property is set to "fail" or "fail-..." πŸ’€ they literally do not get a turn, they're not invited to the function, it's giving filtered out fr fr.


πŸ‘‘ RETURN πŸ‘‘

you get back a cpu node pointer with its refcount incremented πŸ”₯ β€” so bestie, you must call of_node_put on it when you're done, that's not optional, that's the rule πŸ’…

and if prev happens to be the last child? you get NULL back. that's the end of the line, the credits rolling, the 🎬.

oh also β€” it decrements the refcount of prev. so it's doing cleanup on its way past, iconic behavior honestly 🌈


πŸ”₯ SEE ALSO πŸ”₯

the kernel file is ./drivers/of/base.c and here's the whole extended friend group of of_* besties (they all live in the same section 9 neighborhood, iykyk) πŸ’–


okay that's the whole page, mwah πŸ’‹ this lil beauty ships from ./drivers/of and it's dated October 2026 🌸 and it's filed under of_get_next_cpu_node(9) in case you need to find it again β€” go forth and iterate responsibly bestie, and don't forget of_node_put or I will find out πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from