aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorUwe Kleine-König <[email protected]>2024-01-04 23:55:11 +0100
committerStephen Boyd <[email protected]>2024-02-28 17:01:55 -0800
commitb0cde62e4c548b2e7cb535caa6eb0df135888601 (patch)
tree217c73cf57689bc8526f3693edba34ce271c1f44 /include/linux
parent6613476e225e090cc9aad49be7fa504e290dd33d (diff)
clk: Add a devm variant of clk_rate_exclusive_get()
This allows to simplify drivers that use clk_rate_exclusive_get() in their probe routine as calling clk_rate_exclusive_put() is cared for automatically. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Russell King (Oracle) <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clk.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 06f1b292f8a0..24c49b01c25d 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -202,6 +202,18 @@ bool clk_is_match(const struct clk *p, const struct clk *q);
int clk_rate_exclusive_get(struct clk *clk);
/**
+ * devm_clk_rate_exclusive_get - devm variant of clk_rate_exclusive_get
+ * @dev: device the exclusivity is bound to
+ * @clk: clock source
+ *
+ * Calls clk_rate_exclusive_get() on @clk and registers a devm cleanup handler
+ * on @dev to call clk_rate_exclusive_put().
+ *
+ * Must not be called from within atomic context.
+ */
+int devm_clk_rate_exclusive_get(struct device *dev, struct clk *clk);
+
+/**
* clk_rate_exclusive_put - release exclusivity over the rate control of a
* producer
* @clk: clock source