[PATCH] otg: fix link breakage, when the NOP USB Xceiver is a module

Guennadi Liakhovetski g.liakhovetski at gmx.de
Thu Dec 9 16:46:29 EST 2010


If the NOP USB OTG transceiver driver is built as a module, the otg.h 
header declares external functions, but if they are referenced from the 
kernel proper, as, e.g., in the OMAP3 case, where the omap3evm board is 
calling the usb_nop_xceiv_register() function, linkage breaks. This patch 
fixes this problem.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski at gmx.de>
---
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 0a5b371..a1a1e7a 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -116,7 +116,7 @@ struct otg_transceiver {
 /* for board-specific init logic */
 extern int otg_set_transceiver(struct otg_transceiver *);
 
-#if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE)
+#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
 /* sometimes transceivers are accessed only through e.g. ULPI */
 extern void usb_nop_xceiv_register(void);
 extern void usb_nop_xceiv_unregister(void);



More information about the linux-arm-kernel mailing list