of_get_cpu_state_node(9)
β¨ of_get_cpu_state_node β¨
ok so bestie, we're in the Kernel API Manual today and this one's a lil function called of_get_cpu_state_node β that's the manual name too, iykyk π
it lives over in ./drivers/of and it's literally about fetching a CPU's idle state node at whatever index you pass in. come on, let's go π¦
πΈ NAME πΈ
of_get_cpu_state_node β Get CPU's idle state node at the given index
π SYNOPSIS π
struct device_node * of_get_cpu_state_node (const struct device_node
*cpu_node , int index );
π ARGUMENTS π
cpu_nodeβ the device node for the CPU π«Ά like, the actual CPU you're asking aboutindexβ the index in the list of the idle states β¨ so which one in the lineup you want
π₯ DESCRIPTION π₯
okay so this is the tea β there are two generic methods you can use to describe a CPU's idle states, and they're both valid, no cap:
- either via a flattened description through the
"cpu-idle-states"binding - or via the hierarchical layout, using the
"power-domains"and the"domain-idle-states"bindings π
This function checks for both of them and returns the idle state node for the requested index. periodt π
π¦ RETURN π¦
An idle state node if found at index. The refcount is incremented for it, so call of_node_put on it when done. π Returns NULL if not found.
bestie don't forget the of_node_put β the refcount is incremented so you gotta release it when you're done, fr fr π«Ά
β SEE ALSO β
- Kernel file
./drivers/of/cpu.c of_get_cpu_hwid(9)of_get_cpu_node(9)of_cpu_device_node_get(9)of_cpu_node_to_id(9)
that's the whole vibe, bestie β π slay π this page is from ./drivers/of, dated October 2026, and yes it's of_get_cpu_state_node(9) all over again, iconic of her honestly πβ¨
π¦ 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