Skip to contentSkip to conversation

staging: add MEDIA_SUPPORT dependency

PATCH In review Arnd Bergmann 2 participants 4 messages Jul 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: add MEDIA_SUPPORT dependency

staging media drivers tend to have a build time dependency on the media support. In particular, the newly added pulse8 cec driver can only be a loadable module if MEDIA_SUPPORT=m, but its build dependency is on a 'bool' symbol (MEDIA_CEC), so a randconfig build can fail with pulse8_cec built-in:

drivers/staging/built-in.o: In function `pulse8_disconnect':
dgnc_utils.c:(.text+0x114): undefined reference to cec_unregister_adapter' drivers/staging/built-in.o: In function pulse8_irq_work_handler':
dgnc_utils.c:(.text+0x1bc): undefined reference to cec_transmit_done' dgnc_utils.c:(.text+0x1d8): undefined reference to cec_received_msg' dgnc_utils.c:(.text+0x1f4): undefined reference to cec_transmit_done' dgnc_utils.c:(.text+0x218): undefined reference to cec_transmit_done' dgnc_utils.c:(.text+0x23c): undefined reference to cec_transmit_done' drivers/staging/built-in.o: In function pulse8_connect':
dgnc_utils.c:(.text+0x844): undefined reference to cec_allocate_adapter' dgnc_utils.c:(.text+0x8a4): undefined reference to cec_delete_adapter' dgnc_utils.c:(.text+0xa10): undefined reference to `cec_register_adapter'

Originally, MEDIA_CEC itself was a tristate symbol, which would have prevented this, but since 5bb2399a4fe4 ("[media] cec: fix Kconfig dependency problems"), it doesn't work like that any more.

This encloses all of the staging media drivers in a CONFIG_MEDIA_SUPPORT dependency in Kconfig, which solves the problem by enforcing that none of the drivers can be built-in if the media core is a module.

---
 drivers/staging/media/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/Kconfig +1 -1
index cae42e56f270..7292f23954df 100644
@@ -16,7 +16,7 @@ menuconfig STAGING_MEDIA
           If in doubt, say N here.
 
 
-if STAGING_MEDIA
+if STAGING_MEDIA && MEDIA_SUPPORT
 
 # Please keep them in alphabetic order
 source "drivers/staging/media/bcm2048/Kconfig"
Signature · 1 line
2.9.0
#1 lore raw

PATCH 2/2 cec: add RC_CORE dependency

We cannot build the cec driver when the RC core is a module and cec is built-in:

drivers/staging/built-in.o: In function `cec_allocate_adapter':
:(.text+0x134): undefined reference to rc_allocate_device' drivers/staging/built-in.o: In function cec_register_adapter':
:(.text+0x304): undefined reference to `rc_register_device'

This adds an explicit dependency to avoid this case. We still allow building when CONFIG_RC_CORE is disabled completely, as the driver has checks for this case itself.

---
I originally submitted this on June 29, but it may have gotten lost as out of the three patch series, one patch got replaced and another patch got applied, but nothing happened on this one.

---
 drivers/staging/media/cec/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/media/cec/Kconfig +1 -0
index 21457a1f6c9f..c623bd32a5b8 100644
@@ -1,6 +1,7 @@
 config MEDIA_CEC
 	bool "CEC API (EXPERIMENTAL)"
 	depends on MEDIA_SUPPORT
+	depends on RC_CORE || !RC_CORE
 	select MEDIA_CEC_EDID
 	---help---
 	  Enable the CEC API.
Signature · 1 line
2.9.0
#2 lore raw

Re: [PATCH 2/2] [media] cec: add RC_CORE dependency

Quoted 11 lines · Arnd Bergmann

We cannot build the cec driver when the RC core is a module and cec is built-in:

drivers/staging/built-in.o: In function `cec_allocate_adapter':
:(.text+0x134): undefined reference to rc_allocate_device' drivers/staging/built-in.o: In function cec_register_adapter':
:(.text+0x304): undefined reference to `rc_register_device'

This adds an explicit dependency to avoid this case. We still allow building when CONFIG_RC_CORE is disabled completely, as the driver has checks for this case itself.

This makes no sense: the rc_allocate_device and rc_register_device are under:

#if IS_REACHABLE(CONFIG_RC_CORE)

So it shouldn't be enabled at all, should it?

Regards,

Hans

Quoted 23 lines

---
I originally submitted this on June 29, but it may have gotten lost as out of the three patch series, one patch got replaced and another patch got applied, but nothing happened on this one.

---
 drivers/staging/media/cec/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/media/cec/Kconfig +1 -0
index 21457a1f6c9f..c623bd32a5b8 100644
@@ -1,6 +1,7 @@
 config MEDIA_CEC
 	bool "CEC API (EXPERIMENTAL)"
 	depends on MEDIA_SUPPORT
+	depends on RC_CORE || !RC_CORE
 	select MEDIA_CEC_EDID
 	---help---
 	  Enable the CEC API.
#3 lore raw

Re: [PATCH 2/2] [media] cec: add RC_CORE dependency

Quoted 13 lines · CEST Hans Verkuil
Quoted 11 lines · Arnd Bergmann

We cannot build the cec driver when the RC core is a module and cec is built-in:

drivers/staging/built-in.o: In function `cec_allocate_adapter':
:(.text+0x134): undefined reference to rc_allocate_device' drivers/staging/built-in.o: In function cec_register_adapter':
:(.text+0x304): undefined reference to `rc_register_device'

This adds an explicit dependency to avoid this case. We still allow building when CONFIG_RC_CORE is disabled completely, as the driver has checks for this case itself.

Quoted 6 lines

This makes no sense: the rc_allocate_device and rc_register_device are under:

#if IS_REACHABLE(CONFIG_RC_CORE)

So it shouldn't be enabled at all, should it?

My mistake, I forgot to remove my patch from the backlog after you added 5bb2399a4fe4 ("[media] cec: fix Kconfig dependency problems"), and I saw that it's still marked as "new" in patchwork with no reply.

I'll drop the patch from my local series and won't submit it again, sorry for the mixup.

Arnd