usb: dwc3: fix compile failure if config host only mode
authorWu Liang feng <wulf@rock-chips.com>
Mon, 18 Apr 2016 03:37:13 +0000 (11:37 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Mon, 18 Apr 2016 08:59:43 +0000 (16:59 +0800)
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 9607f47dfec23c5773d74e45ed561859eabce2b7
usb: dwc3: add functions to set force mode

Change-Id: Id0abaf89fba006609dbf2e7a771149453465b371
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
drivers/usb/dwc3/core.h

index 142e117d4ac52b6ebad3c442b3491397a252ebb8..ed96f7d113f6f9d8529e6ea736408f4e3418ca3d 100644 (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 */