mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
clk: mediatek: Refactor pll registration to pass device
As it stands, mtk_clk_register_plls takes a struct device_node pointer as its first argument. This is a tragic happenstance, as it's trivial to get the device_node from a struct device, but the opposite not so much. The struct device is a much more useful thing to have passed down. Refactor mtk_clk_register_plls to take a struct device pointer instead of a struct device_node pointer, and fix up all users of this function. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
@@ -978,7 +978,7 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mtk_clk_register_plls(node, apmixed_plls, ARRAY_SIZE(apmixed_plls),
|
||||
mtk_clk_register_plls(&pdev->dev, apmixed_plls, ARRAY_SIZE(apmixed_plls),
|
||||
clk_data);
|
||||
mtk_clk_register_factors(apmixed_fixed_divs, ARRAY_SIZE(apmixed_fixed_divs),
|
||||
clk_data);
|
||||
|
||||
@@ -119,7 +119,7 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
r = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
r = mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
if (r)
|
||||
goto free_clk_data;
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ static int clk_mt6735_apmixed_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
platform_set_drvdata(pdev, clk_data);
|
||||
|
||||
ret = mtk_clk_register_plls(pdev->dev.of_node, apmixedsys_plls,
|
||||
ARRAY_SIZE(apmixedsys_plls), clk_data);
|
||||
ret = mtk_clk_register_plls(&pdev->dev, apmixedsys_plls,
|
||||
ARRAY_SIZE(apmixedsys_plls), clk_data);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to register PLLs: %d\n", ret);
|
||||
return ret;
|
||||
|
||||
@@ -740,7 +740,7 @@ static int clk_mt6765_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
|
||||
mtk_clk_register_gates(&pdev->dev, node, apmixed_clks,
|
||||
ARRAY_SIZE(apmixed_clks), clk_data);
|
||||
|
||||
@@ -1220,7 +1220,7 @@ static int clk_mt6779_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
|
||||
mtk_clk_register_gates(&pdev->dev, node, apmixed_clks,
|
||||
ARRAY_SIZE(apmixed_clks), clk_data);
|
||||
|
||||
@@ -655,7 +655,7 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
|
||||
return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ static int clk_mt7622_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
ret = mtk_clk_register_plls(dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -634,7 +634,7 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls),
|
||||
mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls),
|
||||
clk_data);
|
||||
|
||||
mtk_clk_register_gates(&pdev->dev, node, apmixed_clks,
|
||||
|
||||
@@ -76,7 +76,7 @@ static int clk_mt7981_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
|
||||
r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
|
||||
if (r) {
|
||||
|
||||
@@ -74,7 +74,7 @@ static int clk_mt7986_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
|
||||
r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
|
||||
if (r) {
|
||||
|
||||
@@ -86,7 +86,7 @@ static int clk_mt7988_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
r = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
r = mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
if (r)
|
||||
goto free_apmixed_data;
|
||||
|
||||
|
||||
@@ -57,7 +57,8 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
ret = mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls),
|
||||
clk_data);
|
||||
if (ret)
|
||||
goto free_clk_data;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static int clk_mt8167_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
ret = mtk_clk_register_plls(dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ static int clk_mt8183_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
ret = mtk_clk_register_plls(dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ static int clk_mt8188_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
r = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
|
||||
r = mtk_clk_register_plls(&pdev->dev, plls, ARRAY_SIZE(plls), clk_data);
|
||||
if (r)
|
||||
goto free_apmixed_data;
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@ static int clk_mt8195_apusys_pll_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
r = mtk_clk_register_plls(node, apusys_plls, ARRAY_SIZE(apusys_plls), clk_data);
|
||||
r = mtk_clk_register_plls(&pdev->dev, apusys_plls,
|
||||
ARRAY_SIZE(apusys_plls), clk_data);
|
||||
if (r)
|
||||
goto free_apusys_pll_data;
|
||||
|
||||
|
||||
@@ -152,7 +152,8 @@ static int clk_mt8196_apmixed_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
r = mtk_clk_register_plls(node, mcd->clks, mcd->num_clks, clk_data);
|
||||
r = mtk_clk_register_plls(&pdev->dev, mcd->clks, mcd->num_clks,
|
||||
clk_data);
|
||||
if (r)
|
||||
goto free_apmixed_data;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ static int clk_mt8196_mcu_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
r = mtk_clk_register_plls(node, plls, num_plls, clk_data);
|
||||
r = mtk_clk_register_plls(&pdev->dev, plls, num_plls, clk_data);
|
||||
if (r)
|
||||
goto free_clk_data;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static int clk_mt8196_mfg_probe(struct platform_device *pdev)
|
||||
if (!clk_data)
|
||||
return -ENOMEM;
|
||||
|
||||
r = mtk_clk_register_plls(node, plls, num_plls, clk_data);
|
||||
r = mtk_clk_register_plls(&pdev->dev, plls, num_plls, clk_data);
|
||||
if (r)
|
||||
goto free_clk_data;
|
||||
|
||||
|
||||
@@ -664,7 +664,7 @@ static int clk_mt8196_vlp_probe(struct platform_device *pdev)
|
||||
if (r)
|
||||
goto unregister_factors;
|
||||
|
||||
r = mtk_clk_register_plls(node, vlp_plls, ARRAY_SIZE(vlp_plls),
|
||||
r = mtk_clk_register_plls(dev, vlp_plls, ARRAY_SIZE(vlp_plls),
|
||||
clk_data);
|
||||
if (r)
|
||||
goto unregister_muxes;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user