From: Peter Chen Date: Mon, 12 Aug 2013 01:22:49 +0000 (+0800) Subject: usb: chipidea: udc: otg_set_peripheral is useless for some chipidea users X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=29cf0d156a6b4089b53bff77fa40a13188af61de;p=karo-tx-linux.git 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 Signed-off-by: Peter Chen Signed-off-by: Alexander Shishkin --- 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; }