提交 4dbb7161 编写于 作者: F Felipe Balbi

usb: gadget: mv_udc_core: fix PHY error handling

PHY layer no longer returns NULL. It will
return -ENXIO when PHY layer isn't enabled
and we can use that to bail out instead of
request a probe deferral.
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 d105e7f8
......@@ -2127,16 +2127,19 @@ static int mv_udc_probe(struct platform_device *pdev)
udc->dev = pdev;
#if IS_ENABLED(CONFIG_USB_PHY)
if (pdata->mode == MV_USB_MODE_OTG) {
udc->transceiver = devm_usb_get_phy(&pdev->dev,
USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(udc->transceiver)) {
if (IS_ERR(udc->transceiver)) {
retval = PTR_ERR(udc->transceiver);
if (retval == -ENXIO)
return retval;
udc->transceiver = NULL;
return -ENODEV;
return -EPROBE_DEFER;
}
}
#endif
udc->clknum = pdata->clknum;
for (clk_i = 0; clk_i < udc->clknum; clk_i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册