]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: qcom: hfpll: use clk_parent_data to specify the parent
authorJorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Mon, 25 Nov 2019 13:59:07 +0000 (14:59 +0100)
committerStephen Boyd <sboyd@kernel.org>
Thu, 19 Dec 2019 06:07:52 +0000 (22:07 -0800)
This permits extending the driver to other platforms without having to
modify its source code.

Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Link: https://lkml.kernel.org/r/20191125135910.679310-6-niklas.cassel@linaro.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/qcom/hfpll.c

index 225c675f67797608e234449e4db89d08175b90b8..5ff7f5a6062001e968be8f254ed4689a7ed0d8a9 100644 (file)
@@ -53,7 +53,6 @@ static int qcom_hfpll_probe(struct platform_device *pdev)
        struct regmap *regmap;
        struct clk_hfpll *h;
        struct clk_init_data init = {
-               .parent_names = (const char *[]){ "xo" },
                .num_parents = 1,
                .ops = &clk_ops_hfpll,
                /*
@@ -65,6 +64,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev)
                .flags = CLK_IGNORE_UNUSED,
        };
        int ret;
+       struct clk_parent_data pdata = { .index = 0 };
 
        h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL);
        if (!h)
@@ -83,6 +83,8 @@ static int qcom_hfpll_probe(struct platform_device *pdev)
                                          0, &init.name))
                return -ENODEV;
 
+       init.parent_data = &pdata;
+
        h->d = &hdata;
        h->clkr.hw.init = &init;
        spin_lock_init(&h->lock);