From 409c39ec92a35e3708f5b5798c78eae78512cd71 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 6 Oct 2023 16:39:58 -0500 Subject: clk: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006213959.334439-1-robh@kernel.org Reviewed-by: Dmitry Baryshkov #msm part Acked-by: Krzysztof Kozlowski # Samsung Acked-by: David Lechner Acked-by: Chanwoo Choi Acked-by: Charles Keepax Reviewed-by: Bjorn Andersson Signed-off-by: Stephen Boyd --- drivers/clk/qcom/krait-cc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'drivers/clk/qcom/krait-cc.c') diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c index 410ae8390f1c..ae325f4e1047 100644 --- a/drivers/clk/qcom/krait-cc.c +++ b/drivers/clk/qcom/krait-cc.c @@ -5,10 +5,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -347,22 +347,18 @@ MODULE_DEVICE_TABLE(of, krait_cc_match_table); static int krait_cc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - const struct of_device_id *id; unsigned long cur_rate, aux_rate; int cpu; struct clk_hw *mux, *l2_pri_mux; struct clk *clk, **clks; - - id = of_match_device(krait_cc_match_table, dev); - if (!id) - return -ENODEV; + bool unique_aux = !!device_get_match_data(dev); /* Rate is 1 because 0 causes problems for __clk_mux_determine_rate */ clk = clk_register_fixed_rate(dev, "qsb", NULL, 0, 1); if (IS_ERR(clk)) return PTR_ERR(clk); - if (!id->data) { + if (!unique_aux) { clk = clk_register_fixed_factor(dev, "acpu_aux", "gpll0_vote", 0, 1, 2); if (IS_ERR(clk)) @@ -375,13 +371,13 @@ static int krait_cc_probe(struct platform_device *pdev) return -ENOMEM; for_each_possible_cpu(cpu) { - mux = krait_add_clks(dev, cpu, id->data); + mux = krait_add_clks(dev, cpu, unique_aux); if (IS_ERR(mux)) return PTR_ERR(mux); clks[cpu] = mux->clk; } - l2_pri_mux = krait_add_clks(dev, -1, id->data); + l2_pri_mux = krait_add_clks(dev, -1, unique_aux); if (IS_ERR(l2_pri_mux)) return PTR_ERR(l2_pri_mux); clks[l2_mux] = l2_pri_mux->clk; -- cgit v1.2.3