]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
clk: Add devm_clk_bulk_get_optional_enable() helper
authorSuraj Gupta <suraj.gupta2@amd.com>
Fri, 16 Jan 2026 19:27:23 +0000 (00:57 +0530)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 Jan 2026 02:57:07 +0000 (18:57 -0800)
commit820ce0c8e98a8999f4c233ffb1ca92c27894614e
tree7fcef9064dd7ab615d8d86adf72b673e6564d914
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
clk: Add devm_clk_bulk_get_optional_enable() helper

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@lunn.ch>
Signed-off-by: Suraj Gupta <suraj.gupta2@amd.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Link: https://patch.msgid.link/20260116192725.972966-2-suraj.gupta2@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/clk/clk-devres.c
include/linux/clk.h