diff options
author | Felipe Balbi <balbi@ti.com> | 2013-03-15 10:54:59 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 11:18:28 +0200 |
commit | 4dbb71612505de1d3d69d011199554f86273c5e9 (patch) | |
tree | 48cb79b15b918986cb178d6be57551361d049560 /drivers | |
parent | d105e7f86f890a530cdefc2a715121345de30dc2 (diff) | |
download | linux-3.10-4dbb71612505de1d3d69d011199554f86273c5e9.tar.gz linux-3.10-4dbb71612505de1d3d69d011199554f86273c5e9.tar.bz2 linux-3.10-4dbb71612505de1d3d69d011199554f86273c5e9.zip |
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: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/mv_udc_core.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index d550b212913..9a68c051a5a 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c @@ -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++) { |