1 From 8ea9fb841a7e528bc8ae79d726ce951dcf7b46e2 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Wed, 9 Nov 2022 01:56:30 +0100
4 Subject: [PATCH 5/6] clk: qcom: krait-cc: convert to devm_clk_hw_register
6 clk_register is now deprecated. Convert the driver to devm_clk_hw_register.
8 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
9 Signed-off-by: Bjorn Andersson <andersson@kernel.org>
10 Link: https://lore.kernel.org/r/20221109005631.3189-4-ansuelsmth@gmail.com
12 drivers/clk/qcom/krait-cc.c | 31 +++++++++++++++++++------------
13 1 file changed, 19 insertions(+), 12 deletions(-)
15 --- a/drivers/clk/qcom/krait-cc.c
16 +++ b/drivers/clk/qcom/krait-cc.c
17 @@ -79,8 +79,7 @@ krait_add_div(struct device *dev, int id
18 .flags = CLK_SET_RATE_PARENT,
20 const char *p_names[1];
25 div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL);
27 @@ -103,8 +102,8 @@ krait_add_div(struct device *dev, int id
31 - clk = devm_clk_register(dev, &div->hw);
33 + ret = devm_clk_hw_register(dev, &div->hw);
37 /* clk-krait ignore any rate change if mux is not flagged as enabled */
38 @@ -118,7 +117,7 @@ err:
42 - return PTR_ERR_OR_ZERO(clk);
47 @@ -137,7 +136,6 @@ krait_add_sec_mux(struct device *dev, in
48 .ops = &krait_mux_clk_ops,
49 .flags = CLK_SET_RATE_PARENT,
53 mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);
55 @@ -166,14 +164,16 @@ krait_add_sec_mux(struct device *dev, in
57 sec_mux_list[0] = kasprintf(GFP_KERNEL, "acpu%s_aux", s);
58 if (!sec_mux_list[0]) {
59 - clk = ERR_PTR(-ENOMEM);
65 - clk = devm_clk_register(dev, &mux->hw);
66 + ret = devm_clk_hw_register(dev, &mux->hw);
70 - ret = krait_notifier_register(dev, clk, mux);
71 + ret = krait_notifier_register(dev, mux->hw.clk, mux);
75 @@ -189,7 +189,7 @@ unique_aux:
76 kfree(sec_mux_list[0]);
79 - return PTR_ERR_OR_ZERO(clk);
84 @@ -241,11 +241,18 @@ krait_add_pri_mux(struct device *dev, in
88 - clk = devm_clk_register(dev, &mux->hw);
89 + ret = devm_clk_hw_register(dev, &mux->hw);
97 ret = krait_notifier_register(dev, clk, mux);
100 + clk = ERR_PTR(ret);