Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354675
b: refs/heads/master
c: 449d04a
h: refs/heads/master
i:
  354673: ed7a5aa
  354671: 7627137
v: v3
  • Loading branch information
Chao Xie authored and Felipe Balbi committed Jan 24, 2013
1 parent e8fc706 commit db764b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab592a74a5519d9de2af3003a721cfe0c6684b8a
refs/heads/master: 449d04a977f63e6218d88312f9bd3cb53fb5d30b
15 changes: 10 additions & 5 deletions trunk/drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ static int mv_udc_start(struct usb_gadget *gadget,

spin_unlock_irqrestore(&udc->lock, flags);

if (!IS_ERR_OR_NULL(udc->transceiver)) {
if (udc->transceiver) {
retval = otg_set_peripheral(udc->transceiver->otg,
&udc->gadget);
if (retval) {
Expand Down Expand Up @@ -2174,9 +2174,14 @@ static int mv_udc_probe(struct platform_device *pdev)
udc->dev = pdev;

#ifdef CONFIG_USB_OTG_UTILS
if (pdata->mode == MV_USB_MODE_OTG)
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)) {
udc->transceiver = NULL;
return -ENODEV;
}
}
#endif

udc->clknum = pdata->clknum;
Expand Down Expand Up @@ -2319,7 +2324,7 @@ static int mv_udc_probe(struct platform_device *pdev)
eps_init(udc);

/* VBUS detect: we can disable/enable clock on demand.*/
if (!IS_ERR_OR_NULL(udc->transceiver))
if (udc->transceiver)
udc->clock_gating = 1;
else if (pdata->vbus) {
udc->clock_gating = 1;
Expand Down Expand Up @@ -2386,7 +2391,7 @@ static int mv_udc_suspend(struct device *dev)
udc = dev_get_drvdata(dev);

/* if OTG is enabled, the following will be done in OTG driver*/
if (!IS_ERR_OR_NULL(udc->transceiver))
if (udc->transceiver)
return 0;

if (udc->pdata->vbus && udc->pdata->vbus->poll)
Expand Down Expand Up @@ -2421,7 +2426,7 @@ static int mv_udc_resume(struct device *dev)
udc = dev_get_drvdata(dev);

/* if OTG is enabled, the following will be done in OTG driver*/
if (!IS_ERR_OR_NULL(udc->transceiver))
if (udc->transceiver)
return 0;

if (!udc->clock_gating) {
Expand Down

0 comments on commit db764b6

Please sign in to comment.