Commit d105e7f8 authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: 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: default avatarFelipe Balbi <balbi@ti.com>
parent 817e5f33
...@@ -434,12 +434,32 @@ static int dwc3_probe(struct platform_device *pdev) ...@@ -434,12 +434,32 @@ static int dwc3_probe(struct platform_device *pdev)
dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3); dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
} }
if (IS_ERR_OR_NULL(dwc->usb2_phy)) { if (IS_ERR(dwc->usb2_phy)) {
ret = PTR_ERR(dwc->usb2_phy);
/*
* if -ENXIO is returned, it means PHY layer wasn't
* enabled, so it makes no sense to return -EPROBE_DEFER
* in that case, since no PHY driver will ever probe.
*/
if (ret == -ENXIO)
return ret;
dev_err(dev, "no usb2 phy configured\n"); dev_err(dev, "no usb2 phy configured\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
if (IS_ERR_OR_NULL(dwc->usb3_phy)) { if (IS_ERR(dwc->usb3_phy)) {
ret = PTR_ERR(dwc->usb2_phy);
/*
* if -ENXIO is returned, it means PHY layer wasn't
* enabled, so it makes no sense to return -EPROBE_DEFER
* in that case, since no PHY driver will ever probe.
*/
if (ret == -ENXIO)
return ret;
dev_err(dev, "no usb3 phy configured\n"); dev_err(dev, "no usb3 phy configured\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment