devm_clk_bu..._all_enabled(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ devm_clk_bulk_get_all_enabled ✨

okay bestie so this is a page from the Kernel API Manual and it's about one (1) extremely helpful little function. buckle up, it's lowkey iconic πŸ’…


🌸 NAME 🌸

devm_clk_bulk_get_all_enabled β€” get and enable all the clocks of the consumer, and do it managed, periodt πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int devm_clk_bulk_get_all_enabled (struct device *dev , struct
clk_bulk_data **clks );

like literally that's it, that's the whole signature, she's compact πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • dev β€” the device that's being the clock "consumer" here (yes, that's the actual word they use, it's giving very main character energy πŸ™ˆ)
  • clks β€” a pointer to the consumer's clk_bulk_data table πŸ—‚οΈ

🧚 DESCRIPTION 🧚

okay so here's the tea β˜• β€” the return value is doing a little bit of everything:

  • returns a positive value = that's the number of clocks obtained, and the clock references get stored in the clk_bulk_data table in the clks field πŸŽ‰
  • returns 0 if there're none at all β€” like nobody showed up to the party 😭
  • returns a negative value if something failed β€” code red, something went wrong πŸ’€

This helper function lets drivers get all the clocks of the consumer and enable them in one single operation, with management included, no cap 🫢

The clks will automatically be disabled and freed when the device is unbound β€” like she cleans up after herself, we stan a responsible icon ✨


🌈 SEE ALSO 🌈

Kernel file ./include/linux/clk.h β€” plus this whole friend group right here:

clk notifier callback types(9), struct clk_notifier(9), struct clk_notifier_data(9), struct clk_bulk_data(9), clk_notifier_register(9), clk_notifier_unregister(9), devm_clk_notifier_register(9), clk_get_accuracy(9), clk_set_phase(9), clk_get_phase(9), clk_set_duty_cycle(9), clk_get_scaled_duty_cycle(9), clk_is_match(9), clk_rate_exclusive_get(9), devm_clk_rate_exclusive_get(9), clk_rate_exclusive_put(9), clk_save_context(9), clk_restore_context(9), clk_prepare(9), clk_unprepare(9), clk_is_enabled_when_prepared(9), clk_get(9), clk_bulk_get(9), clk_bulk_get_all(9), clk_bulk_get_optional(9), devm_clk_bulk_get(9), devm_clk_bulk_get_optional(9), devm_clk_bulk_get_enable(9), devm_clk_bulk_get_optional_enable(9), devm_clk_bulk_get_all(9), devm_clk_get(9), devm_clk_get_prepared(9), devm_clk_get_enabled(9), devm_clk_get_optional(9), devm_clk_get_optional_prepared(9), devm_clk_get_optional_enabled(9), devm_clk_get_optional_enabled_with_rate(9), devm_get_clk_from_child(9), clk_enable(9), clk_bulk_enable(9), clk_disable(9), clk_bulk_disable(9), clk_get_rate(9), clk_put(9), clk_bulk_put(9), clk_bulk_put_all(9), devm_clk_put(9), clk_round_rate(9), clk_set_rate(9), clk_set_rate_exclusive(9), clk_has_parent(9), clk_set_rate_range(9), clk_set_min_rate(9), clk_set_max_rate(9), clk_set_parent(9), clk_get_parent(9), clk_get_sys(9), clk_drop_range(9), clk_get_optional(9)

like yes that's a lot of friends, she's verywell-connected πŸπŸ’œ


ngl if your driver is juggling a whole squad of clocks and you don't wanna babysit each one, this is your girl πŸ’…

that's the whole page bestie, love u, see u in the next one πŸ«ΆπŸ’– this one lives in ./include/linux and it's dated October 2026 β€” mwah, bye! πŸŽ€βœ¨

πŸ“¦ where this page comes from