clk_hw_get_dev(9)
π clk_hw_get_dev(9) β like, the Kernel API Manual page you didn't know you needed π
okay so bestie, buckle up, because we're diving into the Kernel API Manual (yes, that's the manual name, it's giving official β¨) and this little function is genuinely so useful. no cap.
πΈ NAME πΈ
clk_hw_get_dev β get the device from a hardware clock. that's it. that's the whole vibe. π
β¨ SYNOPSIS β¨
struct device * clk_hw_get_dev (const struct clk_hw *hw );
literally one function, one pointer, zero drama. iykyk π
π¦ ARGUMENTS π¦
hwβ theclk_hwpointer you're pulling thestruct deviceout of. hand it over and it does the thing. π«Ά
π DESCRIPTION π
so this is a helper function π β a little sidekick β whose whole job is getting the struct device that's associated with a hardware clock. iconic behaviour, honestly.
here's the tea though β: some clock controllers (thinking specifically of the ones registered with CLK_OF_DECLARE π) may not have provided a device pointer while they were registering the clock. so yeah, sometimes there's justβ¦ no device to find. and that's fine, the helper knows the assignment. π₯
π RETURN π
it returns the struct device associated with the clock π β or NULL if there is none. and to be clear, NULL is a totally valid answer here, not a fail. vibe check passed either way. β
π SEE ALSO π
okay this list is long, bestie, but you asked for the whole thing and i would never gatekeep π«Ά. go read these:
- the kernel file
./include/linux/clk-provider.hπ clkframeworkflags(9)struct clk_rate_request(9)struct clk_duty(9)struct clk_spread_spectrum(9)struct clk_ops(9)struct clk_parent_data(9)struct clk_init_data(9)struct clk_hw(9)struct clk_fixed_rate(9)clk_hw_register_fixed_rate(9)devm_clk_hw_register_fixed_rate(9)devm_clk_hw_register_fixed_rate_parent_data(9)clk_hw_register_fixed_rate_parent_hw(9)clk_hw_register_fixed_rate_parent_data(9)clk_hw_register_fixed_rate_with_accuracy(9)clk_hw_register_fixed_rate_with_accuracy_parent_hw(9)clk_hw_register_fixed_rate_with_accuracy_parent_data(9)clk_hw_register_fixed_rate_parent_accuracy(9)struct clk_gate(9)clk_hw_register_gate(9)clk_hw_register_gate_parent_hw(9)clk_hw_register_gate_parent_data(9)devm_clk_hw_register_gate(9)devm_clk_hw_register_gate_parent_hw(9)devm_clk_hw_register_gate_parent_data(9)struct clk_divider(9)clk_register_divider(9)clk_hw_register_divider(9)clk_hw_register_divider_parent_hw(9)clk_hw_register_divider_parent_data(9)clk_hw_register_divider_table(9)clk_hw_register_divider_table_parent_hw(9)clk_hw_register_divider_table_parent_data(9)devm_clk_hw_register_divider(9)devm_clk_hw_register_divider_parent_hw(9)devm_clk_hw_register_divider_parent_data(9)devm_clk_hw_register_divider_table(9)struct clk_mux(9)struct clk_fixed_factor(9)devm_clk_hw_register_fixed_factor_parent_hw(9)struct clk_fractional_divider(9)struct clk_multiplier(9)clk_hw_get_of_node(9)
like i said. a lot. but every single one is in there, so go off, queen. π
π cute sign-off π
and that's the page!! sourced from ./include/linux (the version/location, mwah π), dated October 2026 β mark your calendars bestie, she's from the future π¦. thanks for reading, ily, go get that struct device π
β¨π
π¦ 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