Skip to content

Commit 74401c8

Browse files
jhovoldvinodkoul
authored andcommitted
phy: qcom-qmp-combo: add clock registration helper
In preparation for supporting devicetree bindings which do not use child nodes, add a clock registration helper to handle the registration of both the USB and DP clocks. 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 55b1c39 commit 74401c8

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,6 +2447,22 @@ static int phy_dp_clks_register(struct qmp_combo *qmp, struct device_node *np)
24472447
return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np);
24482448
}
24492449

2450+
static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *usb_np,
2451+
struct device_node *dp_np)
2452+
{
2453+
int ret;
2454+
2455+
ret = phy_pipe_clk_register(qmp, usb_np);
2456+
if (ret)
2457+
return ret;
2458+
2459+
ret = phy_dp_clks_register(qmp, dp_np);
2460+
if (ret)
2461+
return ret;
2462+
2463+
return 0;
2464+
}
2465+
24502466
static int qmp_combo_parse_dt_lecacy_dp(struct qmp_combo *qmp, struct device_node *np)
24512467
{
24522468
struct device *dev = qmp->dev;
@@ -2606,11 +2622,7 @@ static int qmp_combo_probe(struct platform_device *pdev)
26062622
*/
26072623
pm_runtime_forbid(dev);
26082624

2609-
ret = phy_pipe_clk_register(qmp, usb_np);
2610-
if (ret)
2611-
goto err_node_put;
2612-
2613-
ret = phy_dp_clks_register(qmp, dp_np);
2625+
ret = qmp_combo_register_clocks(qmp, usb_np, dp_np);
26142626
if (ret)
26152627
goto err_node_put;
26162628

0 commit comments

Comments
 (0)