Skip to content

Commit ce51f7a

Browse files
jhovoldvinodkoul
authored andcommitted
phy: qcom-qmp-combo: separate clock and provider registration
In preparation for supporting devicetree bindings which do not use child nodes, separate clock registration from clock-provider registration. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 74401c8 commit ce51f7a

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

drivers/phy/qualcomm/phy-qcom-qmp-combo.c

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,6 @@ static int phy_pipe_clk_register(struct qmp_combo *qmp, struct device_node *np)
22432243
struct clk_fixed_rate *fixed = &qmp->pipe_clk_fixed;
22442244
struct clk_init_data init = { };
22452245
char name[64];
2246-
int ret;
22472246

22482247
snprintf(name, sizeof(name), "%s::pipe_clk", dev_name(qmp->dev));
22492248
init.name = name;
@@ -2253,19 +2252,7 @@ static int phy_pipe_clk_register(struct qmp_combo *qmp, struct device_node *np)
22532252
fixed->fixed_rate = 125000000;
22542253
fixed->hw.init = &init;
22552254

2256-
ret = devm_clk_hw_register(qmp->dev, &fixed->hw);
2257-
if (ret)
2258-
return ret;
2259-
2260-
ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &fixed->hw);
2261-
if (ret)
2262-
return ret;
2263-
2264-
/*
2265-
* Roll a devm action because the clock provider is the child node, but
2266-
* the child node is not actually a device.
2267-
*/
2268-
return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np);
2255+
return devm_clk_hw_register(qmp->dev, &fixed->hw);
22692256
}
22702257

22712258
/*
@@ -2436,15 +2423,7 @@ static int phy_dp_clks_register(struct qmp_combo *qmp, struct device_node *np)
24362423
if (ret)
24372424
return ret;
24382425

2439-
ret = of_clk_add_hw_provider(np, qcom_qmp_dp_clks_hw_get, qmp);
2440-
if (ret)
2441-
return ret;
2442-
2443-
/*
2444-
* Roll a devm action because the clock provider is the child node, but
2445-
* the child node is not actually a device.
2446-
*/
2447-
return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np);
2426+
return 0;
24482427
}
24492428

24502429
static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *usb_np,
@@ -2460,7 +2439,24 @@ static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *
24602439
if (ret)
24612440
return ret;
24622441

2463-
return 0;
2442+
ret = of_clk_add_hw_provider(usb_np, of_clk_hw_simple_get,
2443+
&qmp->pipe_clk_fixed.hw);
2444+
if (ret)
2445+
return ret;
2446+
2447+
/*
2448+
* Roll a devm action because the clock provider is the child node, but
2449+
* the child node is not actually a device.
2450+
*/
2451+
ret = devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, usb_np);
2452+
if (ret)
2453+
return ret;
2454+
2455+
ret = of_clk_add_hw_provider(dp_np, qcom_qmp_dp_clks_hw_get, qmp);
2456+
if (ret)
2457+
return ret;
2458+
2459+
return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, dp_np);
24642460
}
24652461

24662462
static int qmp_combo_parse_dt_lecacy_dp(struct qmp_combo *qmp, struct device_node *np)

0 commit comments

Comments
 (0)