usb: chipidea: udc: otg_set_peripheral is useless for some chipidea users
authorPeter Chen <peter.chen@freescale.com>
Wed, 14 Aug 2013 09:44:05 +0000 (12:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2013 19:37:19 +0000 (12:37 -0700)
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>
drivers/usb/chipidea/udc.c

index e475fcda1d6829213e2b6c22c5d2c0c7302c8671..116c76203884b0acbb8b0c4afc6ada76b22a22cc 100644 (file)
@@ -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;
        }