summaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/udc.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-08-14 11:44:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-14 21:37:19 +0200
commitd66895f9df6b880fa3a280f5bdfe919169ca37dd (patch)
tree5ac0d7006b43cfa36f569cfaa59033fb8a0ebbcd /drivers/usb/chipidea/udc.c
parentusb: chipidea: host: add vbus regulator control (diff)
downloadlinux-d66895f9df6b880fa3a280f5bdfe919169ca37dd.tar.xz
linux-d66895f9df6b880fa3a280f5bdfe919169ca37dd.zip
usb: chipidea: udc: otg_set_peripheral is useless for some chipidea users
It is useless at below cases: - If we implement both usb host and device at chipidea driver. - If we don't need phy->otg. Tested-by: Marek Vasut <marex@denx.de> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/udc.c')
-rw-r--r--drivers/usb/chipidea/udc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index e475fcda1d68..116c76203884 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1805,7 +1805,12 @@ static int udc_start(struct ci_hdrc *ci)
if (ci->transceiver) {
retval = otg_set_peripheral(ci->transceiver->otg,
&ci->gadget);
- if (retval)
+ /*
+ * If we implement all USB functions using chipidea drivers,
+ * it doesn't need to call above API, meanwhile, if we only
+ * use gadget function, calling above API is useless.
+ */
+ if (retval && retval != -ENOTSUPP)
goto put_transceiver;
}