From: Li Jun Date: Fri, 31 Jul 2015 02:41:00 +0000 (+0800) Subject: usb: chipidea: add ci->is_otg condition for otg judgement X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3f217e9e96daa3d7741bab705fe9c7798d9951a9;p=linux-beck.git usb: chipidea: add ci->is_otg condition for otg judgement Since some chipidea based controller is not otg capable, add ci->is_otg condition when setting is_otg flag for gadget. Signed-off-by: Li Jun Reviewed-by: Roger Quadros Acked-by: Peter Chen Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index b7cca3e597bf..f5fbe78e8e6a 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1838,8 +1838,8 @@ static int udc_start(struct ci_hdrc *ci) ci->gadget.name = ci->platdata->name; ci->gadget.otg_caps = otg_caps; - if (otg_caps->hnp_support || otg_caps->srp_support || - otg_caps->adp_support) + if (ci->is_otg && (otg_caps->hnp_support || otg_caps->srp_support || + otg_caps->adp_support)) ci->gadget.is_otg = 1; INIT_LIST_HEAD(&ci->gadget.ep_list);