Unverified Commit c9ced38a authored by Nicolas Frattaroli's avatar Nicolas Frattaroli Committed by Stephen Boyd
Browse files

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: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Signed-off-by: default avatarNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 66991767
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;

+2 −2
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ 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,
	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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
Loading