usb: dwc3: fix compile failure if config host only mode

This patch fixes following compile error in dwc3 if select
CONFIG_USB_DWC3_HOST.

drivers/usb/dwc3/core.c:874: undefined reference to `dwc3_gadget_restart'
drivers/usb/dwc3/core.c:880: undefined reference to `dwc3_gadget_restart'

which was caused by commit
commit 9607f47dfe
usb: dwc3: add functions to set force mode

Change-Id: Id0abaf89fba006609dbf2e7a771149453465b371
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
This commit is contained in:
Wu Liang feng 2016-04-18 11:37:13 +08:00 committed by Gerrit Code Review
parent 151c8e994c
commit 268399dd65

View File

@ -1053,7 +1053,6 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc);
int dwc3_soft_reset(struct dwc3 *dwc);
int dwc3_event_buffers_setup(struct dwc3 *dwc);
void dwc3_event_buffers_cleanup(struct dwc3 *dwc);
int dwc3_gadget_restart(struct dwc3 *dwc, bool start);
bool dwc3_force_mode(struct dwc3 *dwc, u32 mode);
#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
@ -1075,6 +1074,7 @@ int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state state);
int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
unsigned cmd, struct dwc3_gadget_ep_cmd_params *params);
int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param);
int dwc3_gadget_restart(struct dwc3 *dwc, bool start);
#else
static inline int dwc3_gadget_init(struct dwc3 *dwc)
{ return 0; }
@ -1094,6 +1094,8 @@ static inline int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc,
int cmd, u32 param)
{ return 0; }
static inline int dwc3_gadget_restart(struct dwc3 *dwc, bool start)
{ return 0; }
#endif
/* power management interface */