Thread (9 messages) 9 messages, 4 authors, 2024-12-24

Re: [PATCH 1/3] clk: add a clk_hw helper to get the associate device structure

From: Stephen Boyd <sboyd@kernel.org>
Date: 2024-12-20 23:55:23
Also in: linux-amlogic, linux-clk, lkml

Quoting Jerome Brunet (2024-12-20 09:17:42)
Add an helper function to get the 'struct device' associated with
Add a helper
an a 'clk_hw'. This can be used by clock drivers to access various
with a 'clk_hw'
device related functionnalities such as devres, dev_ prints, etc ...
s/functionnalities/functionality/
quoted hunk ↗ jump to hunk
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/clk.c            | 6 ++++++
 include/linux/clk-provider.h | 1 +
 2 files changed, 7 insertions(+)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 9b45fa005030f56e1478b9742715ebcde898133f..7e734d2955978cafd77d911562a26f1646684ec2 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -365,6 +365,12 @@ const char *clk_hw_get_name(const struct clk_hw *hw)
 }
 EXPORT_SYMBOL_GPL(clk_hw_get_name);
 
+struct device *clk_hw_get_dev(const struct clk_hw *hw)
Please document with kernel doc
+{
+       return hw->core->dev;
+}
+EXPORT_SYMBOL_GPL(clk_hw_get_dev);
I suspect a quick KUnit test can be written up as well that confirms the
device the clk is registered with is returned.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help