phy: qcom-qmp-combo: fix type-c switch registration

Due to a long-standing issue in driver core, drivers may not probe defer
after having registered child devices to avoid triggering a probe
deferral loop (see fbc35b45f9f6 ("Add documentation on meaning of
-EPROBE_DEFER")).

Move registration of the typec switch to after looking up clocks and
other resources.

Note that PHY creation can in theory also trigger a probe deferral when
a 'phy' supply is used. This does not seem to affect the QMP PHY driver
but the PHY subsystem should be reworked to address this (i.e. by
separating initialisation and registration of the PHY).

Fixes: 2851117f8f42 ("phy: qcom-qmp-combo: Introduce orientation switching")
Cc: stable@vger.kernel.org # 6.5
Cc: Bjorn Andersson <quic_bjorande@quicinc.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240217150228.5788-7-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by Johan Hovold and committed by Vinod Koul 47b412c1 d2d7b8e8

Changed files
+4 -4
drivers
phy
+4 -4
drivers/phy/qualcomm/phy-qcom-qmp-combo.c
··· 3562 3562 if (ret) 3563 3563 return ret; 3564 3564 3565 - ret = qmp_combo_typec_switch_register(qmp); 3566 - if (ret) 3567 - return ret; 3568 - 3569 3565 /* Check for legacy binding with child nodes. */ 3570 3566 usb_np = of_get_child_by_name(dev->of_node, "usb3-phy"); 3571 3567 if (usb_np) { ··· 3578 3582 3579 3583 ret = qmp_combo_parse_dt(qmp); 3580 3584 } 3585 + if (ret) 3586 + goto err_node_put; 3587 + 3588 + ret = qmp_combo_typec_switch_register(qmp); 3581 3589 if (ret) 3582 3590 goto err_node_put; 3583 3591