Skip to contentSkip to conversation

include/linux/usb/usb_phy_gen_xceiv.h: check built-in or module for swithing usb_nop_xceiv_register() implementation

PATCH In review Chen Gang 2 participants 4 messages Oct 23, 2013 – Nov 15, 2013 USB

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 include/linux/usb/usb_phy_gen_xceiv.h: check built-in or module for swithing usb_nop_xceiv_register() implementation

When CONFIG_NOP_USB_XCEIV is as 'm', usb_nop_xceiv_register() will be exported when the related module is loaded. So for built-in source code, still need use the empty one.

Or it will can not pass compiling, the related error (for arm, with allmodconfig):

arch/arm/mach-omap2/built-in.o: In function `omap3_evm_init':
arch/arm/mach-omap2/board-omap3evm.c:703: undefined reference to `usb_nop_xceiv_register'

---
 include/linux/usb/usb_phy_gen_xceiv.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/usb/usb_phy_gen_xceiv.h +2 -1
index f9a7e7b..8515958 100644
@@ -12,7 +12,8 @@ struct usb_phy_gen_xceiv_platform_data {
 	unsigned int needs_reset:1;
 };
 
-#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
+#if IS_BUILTIN(CONFIG_NOP_USB_XCEIV) || \
+	(IS_MODULE(CONFIG_NOP_USB_XCEIV) && 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);
Signature · 1 line
1.7.7.6
author
#1 lore raw

Hello Maintainers:

Please help check this patch, when you have time.

Thanks.

Quoted 31 lines · Chen Gang

When CONFIG_NOP_USB_XCEIV is as 'm', usb_nop_xceiv_register() will be exported when the related module is loaded. So for built-in source code, still need use the empty one.

Or it will can not pass compiling, the related error (for arm, with allmodconfig):

arch/arm/mach-omap2/built-in.o: In function `omap3_evm_init':
arch/arm/mach-omap2/board-omap3evm.c:703: undefined reference to `usb_nop_xceiv_register'

---
 include/linux/usb/usb_phy_gen_xceiv.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/usb/usb_phy_gen_xceiv.h +2 -1
index f9a7e7b..8515958 100644
@@ -12,7 +12,8 @@ struct usb_phy_gen_xceiv_platform_data {
 	unsigned int needs_reset:1;
 };
 
-#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
+#if IS_BUILTIN(CONFIG_NOP_USB_XCEIV) || \
+	(IS_MODULE(CONFIG_NOP_USB_XCEIV) && 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);
Signature · 1 line
Chen Gang
#2 lore raw
In reply to Chen Gang
Quoted 4 lines · Chen Gang

When CONFIG_NOP_USB_XCEIV is as 'm', usb_nop_xceiv_register() will be exported when the related module is loaded. So for built-in source code, still need use the empty one.

Quoted 8 lines

Or it will can not pass compiling, the related error (for arm, with allmodconfig):

arch/arm/mach-omap2/built-in.o: In function `omap3_evm_init':
arch/arm/mach-omap2/board-omap3evm.c:703: undefined reference to `usb_nop_xceiv_register'

Added Felipe to cc, he should probably deal with this one.

Regards,

Tony

Quoted 20 lines
---
 include/linux/usb/usb_phy_gen_xceiv.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/usb/usb_phy_gen_xceiv.h +2 -1
index f9a7e7b..8515958 100644
@@ -12,7 +12,8 @@ struct usb_phy_gen_xceiv_platform_data {
 	unsigned int needs_reset:1;
 };
 
-#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
+#if IS_BUILTIN(CONFIG_NOP_USB_XCEIV) || \
+	(IS_MODULE(CONFIG_NOP_USB_XCEIV) && 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);
Signature · 1 line
1.7.7.6
author
#3 lore raw
Quoted 8 lines · Tony Lindgren
Quoted 7 lines · Chen Gang

When CONFIG_NOP_USB_XCEIV is as 'm', usb_nop_xceiv_register() will be exported when the related module is loaded. So for built-in source code, still need use the empty one.

Or it will can not pass compiling, the related error (for arm, with allmodconfig):

Quoted 8 lines
Quoted 5 lines

arch/arm/mach-omap2/built-in.o: In function `omap3_evm_init':
arch/arm/mach-omap2/board-omap3evm.c:703: undefined reference to `usb_nop_xceiv_register'

Added Felipe to cc, he should probably deal with this one.

OK, thank you very much.

And welcome Felipe to help checking, when he has time.

:-)

Quoted 26 lines

Regards,

Tony

Quoted 20 lines
---
 include/linux/usb/usb_phy_gen_xceiv.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/usb/usb_phy_gen_xceiv.h +2 -1
index f9a7e7b..8515958 100644
@@ -12,7 +12,8 @@ struct usb_phy_gen_xceiv_platform_data {
 	unsigned int needs_reset:1;
 };
 
-#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
+#if IS_BUILTIN(CONFIG_NOP_USB_XCEIV) || \
+	(IS_MODULE(CONFIG_NOP_USB_XCEIV) && 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);
Signature · 1 line
1.7.7.6
Signature · 1 line
Chen Gang