diff options
-rw-r--r-- | drivers/usb/dwc3/core.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c845e7087069..e2325adf9c14 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
@@ -434,12 +434,32 @@ static int dwc3_probe(struct platform_device *pdev) | |||
434 | dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3); | 434 | dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3); |
435 | } | 435 | } |
436 | 436 | ||
437 | if (IS_ERR_OR_NULL(dwc->usb2_phy)) { | 437 | if (IS_ERR(dwc->usb2_phy)) { |
438 | ret = PTR_ERR(dwc->usb2_phy); | ||
439 | |||
440 | /* | ||
441 | * if -ENXIO is returned, it means PHY layer wasn't | ||
442 | * enabled, so it makes no sense to return -EPROBE_DEFER | ||
443 | * in that case, since no PHY driver will ever probe. | ||
444 | */ | ||
445 | if (ret == -ENXIO) | ||
446 | return ret; | ||
447 | |||
438 | dev_err(dev, "no usb2 phy configured\n"); | 448 | dev_err(dev, "no usb2 phy configured\n"); |
439 | return -EPROBE_DEFER; | 449 | return -EPROBE_DEFER; |
440 | } | 450 | } |
441 | 451 | ||
442 | if (IS_ERR_OR_NULL(dwc->usb3_phy)) { | 452 | if (IS_ERR(dwc->usb3_phy)) { |
453 | ret = PTR_ERR(dwc->usb2_phy); | ||
454 | |||
455 | /* | ||
456 | * if -ENXIO is returned, it means PHY layer wasn't | ||
457 | * enabled, so it makes no sense to return -EPROBE_DEFER | ||
458 | * in that case, since no PHY driver will ever probe. | ||
459 | */ | ||
460 | if (ret == -ENXIO) | ||
461 | return ret; | ||
462 | |||
443 | dev_err(dev, "no usb3 phy configured\n"); | 463 | dev_err(dev, "no usb3 phy configured\n"); |
444 | return -EPROBE_DEFER; | 464 | return -EPROBE_DEFER; |
445 | } | 465 | } |