Skip to content

Commit

Permalink
usb: gadget: mv_udc_core: fix PHY error handling
Browse files Browse the repository at this point in the history
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: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Mar 18, 2013
1 parent d105e7f commit 4dbb716
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 4dbb716

Please sign in to comment.