aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/mv_udc_core.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index ba6b4fbaad09..67d72f97a09b 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -1394,7 +1394,7 @@ static int mv_udc_start(struct usb_gadget *gadget,
1394 1394
1395 spin_unlock_irqrestore(&udc->lock, flags); 1395 spin_unlock_irqrestore(&udc->lock, flags);
1396 1396
1397 if (!IS_ERR_OR_NULL(udc->transceiver)) { 1397 if (udc->transceiver) {
1398 retval = otg_set_peripheral(udc->transceiver->otg, 1398 retval = otg_set_peripheral(udc->transceiver->otg,
1399 &udc->gadget); 1399 &udc->gadget);
1400 if (retval) { 1400 if (retval) {
@@ -2174,9 +2174,14 @@ static int mv_udc_probe(struct platform_device *pdev)
2174 udc->dev = pdev; 2174 udc->dev = pdev;
2175 2175
2176#ifdef CONFIG_USB_OTG_UTILS 2176#ifdef CONFIG_USB_OTG_UTILS
2177 if (pdata->mode == MV_USB_MODE_OTG) 2177 if (pdata->mode == MV_USB_MODE_OTG) {
2178 udc->transceiver = devm_usb_get_phy(&pdev->dev, 2178 udc->transceiver = devm_usb_get_phy(&pdev->dev,
2179 USB_PHY_TYPE_USB2); 2179 USB_PHY_TYPE_USB2);
2180 if (IS_ERR_OR_NULL(udc->transceiver)) {
2181 udc->transceiver = NULL;
2182 return -ENODEV;
2183 }
2184 }
2180#endif 2185#endif
2181 2186
2182 udc->clknum = pdata->clknum; 2187 udc->clknum = pdata->clknum;
@@ -2319,7 +2324,7 @@ static int mv_udc_probe(struct platform_device *pdev)
2319 eps_init(udc); 2324 eps_init(udc);
2320 2325
2321 /* VBUS detect: we can disable/enable clock on demand.*/ 2326 /* VBUS detect: we can disable/enable clock on demand.*/
2322 if (!IS_ERR_OR_NULL(udc->transceiver)) 2327 if (udc->transceiver)
2323 udc->clock_gating = 1; 2328 udc->clock_gating = 1;
2324 else if (pdata->vbus) { 2329 else if (pdata->vbus) {
2325 udc->clock_gating = 1; 2330 udc->clock_gating = 1;
@@ -2386,7 +2391,7 @@ static int mv_udc_suspend(struct device *dev)
2386 udc = dev_get_drvdata(dev); 2391 udc = dev_get_drvdata(dev);
2387 2392
2388 /* if OTG is enabled, the following will be done in OTG driver*/ 2393 /* if OTG is enabled, the following will be done in OTG driver*/
2389 if (!IS_ERR_OR_NULL(udc->transceiver)) 2394 if (udc->transceiver)
2390 return 0; 2395 return 0;
2391 2396
2392 if (udc->pdata->vbus && udc->pdata->vbus->poll) 2397 if (udc->pdata->vbus && udc->pdata->vbus->poll)
@@ -2421,7 +2426,7 @@ static int mv_udc_resume(struct device *dev)
2421 udc = dev_get_drvdata(dev); 2426 udc = dev_get_drvdata(dev);
2422 2427
2423 /* if OTG is enabled, the following will be done in OTG driver*/ 2428 /* if OTG is enabled, the following will be done in OTG driver*/
2424 if (!IS_ERR_OR_NULL(udc->transceiver)) 2429 if (udc->transceiver)
2425 return 0; 2430 return 0;
2426 2431
2427 if (!udc->clock_gating) { 2432 if (!udc->clock_gating) {