[PATCH V3 1/2] clk: Add devm_clk_bulk_get_optional_enable() helper

Stephen Boyd sboyd at kernel.org
Tue Jan 20 19:50:43 PST 2026


Quoting Suraj Gupta (2026-01-16 12:27:23)
> Add a new managed clock framework helper function that combines getting
> optional bulk clocks and enabling them in a single operation.
> 
> The devm_clk_bulk_get_optional_enable() function simplifies the common
> pattern where drivers need to get optional bulk clocks, prepare and enable
> them, and have them automatically disabled/unprepared and freed when the
> device is unbound.
> 
> This new API follows the established pattern of
> devm_clk_bulk_get_all_enabled() and reduces boilerplate code in drivers
> that manage multiple optional clocks.
> 
> Suggested-by: Andrew Lunn <andrew at lunn.ch>
> Signed-off-by: Suraj Gupta <suraj.gupta2 at amd.com>
> Reviewed-by: Brian Masney <bmasney at redhat.com>
> ---

Acked-by: Stephen Boyd <sboyd at kernel.org>



More information about the linux-arm-kernel mailing list