[PATCH 06/12] clk: define clk_hw_register

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Jan 30 23:57:19 PST 2022

Save users the hassle of opencoding by providing a wrapper with the same
Linux semantics: same arguments and return type.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
 include/linux/clk.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/clk.h b/include/linux/clk.h
index 03d46de25ac6..6e59418aba3c 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -683,6 +683,11 @@ int clk_parent_set_rate(struct clk_hw *hw, unsigned long rate,
 int bclk_register(struct clk *clk);
 struct clk *clk_register(struct device_d *dev, struct clk_hw *hw);
+static inline int clk_hw_register(struct device_d *dev, struct clk_hw *hw)
+	return PTR_ERR_OR_ZERO(clk_register(dev, hw));
 struct clk *clk_lookup(const char *name);
 void clk_dump(int verbose);

More information about the barebox mailing list