of_get_cpu_state_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 about
  • index β€” 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:

  1. either via a flattened description through the "cpu-idle-states" binding
  2. 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 ⭐


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