diff mbox

[-next] usb: fix dwc3 build when USB_GADGET_DWC3 is not enabled

Message ID 20110823110702.f5ea377c.rdunlap@xenotime.net (mailing list archive)
State New, archived
Headers show

Commit Message

Randy Dunlap Aug. 23, 2011, 6:07 p.m. UTC
From: Randy Dunlap <rdunlap@xenotime.net>

Fix build error when CONFIG_USB_GADGET_DWC3 is not enabled:

ERROR: "dwc3_send_gadget_ep_cmd" [drivers/usb/dwc3/dwc3.ko] undefined!

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 drivers/usb/dwc3/debugfs.c |    4 ++++
 1 file changed, 4 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Felipe Balbi Aug. 23, 2011, 6:52 p.m. UTC | #1
Hi,

On Tue, Aug 23, 2011 at 11:07:02AM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
> 
> Fix build error when CONFIG_USB_GADGET_DWC3 is not enabled:
> 
> ERROR: "dwc3_send_gadget_ep_cmd" [drivers/usb/dwc3/dwc3.ko] undefined!
> 
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> ---
>  drivers/usb/dwc3/debugfs.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> --- linux-next-20110823.orig/drivers/usb/dwc3/debugfs.c
> +++ linux-next-20110823/drivers/usb/dwc3/debugfs.c
> @@ -437,7 +437,9 @@ static int dwc3_testmode_open(struct ino
>  	struct dwc3_gadget_ep_cmd_params par0;
>  	struct dwc3_gadget_ep_cmd_params par1;
>  	struct dwc3_trb         trb;
> +#ifdef CONFIG_USB_GADGET_DWC3
>  	int ret;
> +#endif
>  	u8 *buf0;
>  	u8 *buf1;
>  
> @@ -478,8 +480,10 @@ static int dwc3_testmode_open(struct ino
>  
>  	dwc3_send_testmode_cmd(dwc, 1);
>  
> +#ifdef CONFIG_USB_GADGET_DWC3
>  	ret = dwc3_send_gadget_ep_cmd(dwc, 0, DWC3_DEPCMD_STARTTRANSFER, &par0);
>  	ret = dwc3_send_gadget_ep_cmd(dwc, 1, DWC3_DEPCMD_STARTTRANSFER, &par1);
> +#endif

instead of adding the ifdef here, would you add it gadget.h and provide
a nop when we're not building the gadget side ?
diff mbox

Patch

--- linux-next-20110823.orig/drivers/usb/dwc3/debugfs.c
+++ linux-next-20110823/drivers/usb/dwc3/debugfs.c
@@ -437,7 +437,9 @@  static int dwc3_testmode_open(struct ino
 	struct dwc3_gadget_ep_cmd_params par0;
 	struct dwc3_gadget_ep_cmd_params par1;
 	struct dwc3_trb         trb;
+#ifdef CONFIG_USB_GADGET_DWC3
 	int ret;
+#endif
 	u8 *buf0;
 	u8 *buf1;
 
@@ -478,8 +480,10 @@  static int dwc3_testmode_open(struct ino
 
 	dwc3_send_testmode_cmd(dwc, 1);
 
+#ifdef CONFIG_USB_GADGET_DWC3
 	ret = dwc3_send_gadget_ep_cmd(dwc, 0, DWC3_DEPCMD_STARTTRANSFER, &par0);
 	ret = dwc3_send_gadget_ep_cmd(dwc, 1, DWC3_DEPCMD_STARTTRANSFER, &par1);
+#endif
 
 	dwc3_send_testmode_cmd(dwc, 0);
 	return -EBUSY;