Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: s2mps11: Migrate to clk_hw based OF and registration APIs

Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers while registering clks in
these drivers, allowing us to move closer to a clear split of
consumer and provider clk APIs.

Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Acked-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Stephen Boyd and committed by
Stephen Boyd
b228fad5 4e950d1e

+9 -12
+9 -12
drivers/clk/clk-s2mps11.c
··· 137 137 { 138 138 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); 139 139 struct s2mps11_clk *s2mps11_clks; 140 - struct clk_onecell_data *clk_data; 140 + struct clk_hw_onecell_data *clk_data; 141 141 unsigned int s2mps11_reg; 142 142 int i, ret = 0; 143 143 enum sec_device_type hwid = platform_get_device_id(pdev)->driver_data; ··· 147 147 if (!s2mps11_clks) 148 148 return -ENOMEM; 149 149 150 - clk_data = devm_kzalloc(&pdev->dev, sizeof(*clk_data), GFP_KERNEL); 150 + clk_data = devm_kzalloc(&pdev->dev, sizeof(*clk_data) + 151 + sizeof(*clk_data->hws) * S2MPS11_CLKS_NUM, 152 + GFP_KERNEL); 151 153 if (!clk_data) 152 - return -ENOMEM; 153 - 154 - clk_data->clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM, 155 - sizeof(struct clk *), GFP_KERNEL); 156 - if (!clk_data->clks) 157 154 return -ENOMEM; 158 155 159 156 switch (hwid) { ··· 193 196 goto err_reg; 194 197 } 195 198 196 - s2mps11_clks[i].lookup = clkdev_create(s2mps11_clks[i].clk, 199 + s2mps11_clks[i].lookup = clkdev_hw_create(&s2mps11_clks[i].hw, 197 200 s2mps11_clks_init[i].name, NULL); 198 201 if (!s2mps11_clks[i].lookup) { 199 202 ret = -ENOMEM; 200 203 goto err_reg; 201 204 } 202 - clk_data->clks[i] = s2mps11_clks[i].clk; 205 + clk_data->hws[i] = &s2mps11_clks[i].hw; 203 206 } 204 207 205 - clk_data->clk_num = S2MPS11_CLKS_NUM; 206 - of_clk_add_provider(s2mps11_clks->clk_np, of_clk_src_onecell_get, 207 - clk_data); 208 + clk_data->num = S2MPS11_CLKS_NUM; 209 + of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get, 210 + clk_data); 208 211 209 212 platform_set_drvdata(pdev, s2mps11_clks); 210 213