phy: stm32: defer probe for reset controller
authorAmelie Delaunay <amelie.delaunay@st.com>
Tue, 10 Nov 2020 10:23:05 +0000 (11:23 +0100)
committerVinod Koul <vkoul@kernel.org>
Mon, 16 Nov 2020 09:49:03 +0000 (15:19 +0530)
Change stm32-usbphyc driver to defer its probe when the expected reset
control has its probe operation deferred.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Link: https://lore.kernel.org/r/20201110102305.27205-2-amelie.delaunay@st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/st/phy-stm32-usbphyc.c

index 8ebfd56..a54317e 100644 (file)
@@ -340,6 +340,10 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
                reset_control_assert(usbphyc->rst);
                udelay(2);
                reset_control_deassert(usbphyc->rst);
+       } else {
+               ret = PTR_ERR(usbphyc->rst);
+               if (ret == -EPROBE_DEFER)
+                       goto clk_disable;
        }
 
        usbphyc->switch_setup = -EINVAL;