__cpuidle_register_driver(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __cpuidle_register_driver(9) πŸ’–

okay so bestie, we're in the Kernel API Manual today and this page is all about __cpuidle_register_driver β€” yes the double-underscore one, she's the internal baddie, don't confuse her with the regular one (more on that in SEE ALSO, and trust, there are so many of them) 🫢


✨ NAME ✨

__cpuidle_register_driver β€” register the driver. that's it, that's the name, she does exactly what it says on the tin πŸ’…


🌸 SYNOPSIS 🌸

int __cpuidle_register_driver (struct cpuidle_driver *drv );

like, she takes one pointer and hands you back an int. iconic signature, no notes πŸ”₯


πŸ¦‹ ARGUMENTS πŸ¦‹

  • drv β€” a valid pointer to a struct cpuidle_driver. and when I say valid, I mean it, because the very next section is about what happens when you don't bring a valid one 😭

πŸŽ€ DESCRIPTION πŸŽ€

so here's the vibe check: she does some sanity checks first (gotta make sure you're not about to do something goofy), then she initializes the driver, then she assigns the driver to the global cpuidle driver variable(s), and then β€” the main character move β€” she sets up the broadcast timer if the cpuidle driver has some states that shut down the local timer. yes, those states. you know the ones. ⏰

Returns 0 on success, a negative error code otherwise:

  • -EINVAL β€” if the driver pointer is NULL or no idle states are available. literally nothing to work with, bestie πŸ’€
  • -ENODEV β€” if the cpuidle framework is disabled. she's not even home rn πŸ™ˆ
  • -EBUSY β€” if the driver is already assigned to the global variable(s). taken. spoken for. not available. no cap 🌈
lowkey important: those three error codes are the only documented ones here, so don't go inventing extra ones and blaming her βœ‹

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/cpuidle/driver.c β€” and the whole friend group:

__cpuidle_get_cpu_driver(9), __cpuidle_unset_driver(9), __cpuidle_set_driver(9), __cpuidle_get_cpu_driver(9), __cpuidle_set_driver(9), __cpuidle_unset_driver(9), cpuidle_setup_broadcast_timer(9), __cpuidle_driver_init(9), __cpuidle_unregister_driver(9), cpuidle_register_driver(9), cpuidle_unregister_driver(9), cpuidle_get_driver(9), cpuidle_get_cpu_driver(9), cpuidle_driver_state_disabled(9)

(and yes, some of them are listed twice β€” that's the original's energy, we're not touching it, we respect the lore 🧚)


⭐ and that's the page!! sourced straight from ./drivers/cpuidle, dated October 2026, and she's titled __cpuidle_register_driver(9) if you need to cite her in your group chat. slay, go register some drivers responsibly πŸ’œ

πŸ“¦ where this page comes from