public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] v4l2/dvb: allow v4l2_mc functions to be used by dvb
@ 2016-02-28 20:51 Arnd Bergmann
  2016-03-03 17:29 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-02-28 20:51 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, Hans Verkuil, linux-media,
	linux-kernel

In a configuration that supports all DVB drivers but that disables
V4L2 or builds it as a loadable module, we get link errors because
of the recent change to use __v4l2_mc_usb_media_device_init:

drivers/media/built-in.o: In function `dvb_usb_adapter_dvb_init':
:(.text+0xe7966): undefined reference to `__v4l2_mc_usb_media_device_init'
drivers/media/built-in.o: In function `dvb_usbv2_init':
:(.text+0xff1cc): undefined reference to `__v4l2_mc_usb_media_device_init'
drivers/media/built-in.o: In function `smsusb_init_device':
:(.text+0x113be4): undefined reference to `__v4l2_mc_usb_media_device_init'
drivers/media/built-in.o: In function `au0828_usb_probe':
:(.text+0x114d08): undefined reference to `__v4l2_mc_usb_media_device_init'

This patch is one way out, by simply building the v4l2-mc.c file
whenever at least one of VIDEO_V4L2 or DVB_CORE are enabled, including
the case that one of them is a module and the other is built-in, which
leads the MC code to become built-in as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/Makefile           | 2 +-
 drivers/media/v4l2-core/Makefile | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/media/Makefile b/drivers/media/Makefile
index e608bbce0c35..16d471a56c0f 100644
--- a/drivers/media/Makefile
+++ b/drivers/media/Makefile
@@ -19,7 +19,7 @@ ifeq ($(CONFIG_MEDIA_CONTROLLER),y)
 endif
 
 obj-$(CONFIG_VIDEO_DEV) += v4l2-core/
-obj-$(CONFIG_DVB_CORE)  += dvb-core/
+obj-$(CONFIG_DVB_CORE)  += dvb-core/ v4l2-core/
 
 # There are both core and drivers at RC subtree - merge before drivers
 obj-y += rc/
diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index 795a5352761d..c26472f9950e 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -16,7 +16,11 @@ endif
 ifeq ($(CONFIG_TRACEPOINTS),y)
   videodev-objs += vb2-trace.o v4l2-trace.o
 endif
-videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
+
+ifdef CONFIG_MEDIA_CONTROLLER
+obj-$(CONFIG_VIDEO_V4L2) += v4l2-mc.o
+obj-$(CONFIG_DVB_CORE) += v4l2-mc.o
+endif
 
 obj-$(CONFIG_VIDEO_V4L2) += videodev.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
@@ -28,6 +32,7 @@ obj-$(CONFIG_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o
 
 obj-$(CONFIG_V4L2_FLASH_LED_CLASS) += v4l2-flash-led-class.o
 
+ifdef CONFIG_VIDEO_V4L2
 obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o
 obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o
 obj-$(CONFIG_VIDEOBUF_DMA_CONTIG) += videobuf-dma-contig.o
@@ -40,6 +45,7 @@ obj-$(CONFIG_VIDEOBUF2_VMALLOC) += videobuf2-vmalloc.o
 obj-$(CONFIG_VIDEOBUF2_DMA_CONTIG) += videobuf2-dma-contig.o
 obj-$(CONFIG_VIDEOBUF2_DMA_SG) += videobuf2-dma-sg.o
 obj-$(CONFIG_VIDEOBUF2_DVB) += videobuf2-dvb.o
+endif
 
 ccflags-y += -I$(srctree)/drivers/media/dvb-core
 ccflags-y += -I$(srctree)/drivers/media/dvb-frontends
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [media] v4l2/dvb: allow v4l2_mc functions to be used by dvb
  2016-02-28 20:51 [PATCH] [media] v4l2/dvb: allow v4l2_mc functions to be used by dvb Arnd Bergmann
@ 2016-03-03 17:29 ` Mauro Carvalho Chehab
  2016-03-04 15:37   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2016-03-03 17:29 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arm-kernel, Hans Verkuil, linux-media, linux-kernel

Em Sun, 28 Feb 2016 21:51:48 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> In a configuration that supports all DVB drivers but that disables
> V4L2 or builds it as a loadable module, we get link errors because
> of the recent change to use __v4l2_mc_usb_media_device_init:
> 
> drivers/media/built-in.o: In function `dvb_usb_adapter_dvb_init':
> :(.text+0xe7966): undefined reference to `__v4l2_mc_usb_media_device_init'
> drivers/media/built-in.o: In function `dvb_usbv2_init':
> :(.text+0xff1cc): undefined reference to `__v4l2_mc_usb_media_device_init'
> drivers/media/built-in.o: In function `smsusb_init_device':
> :(.text+0x113be4): undefined reference to `__v4l2_mc_usb_media_device_init'
> drivers/media/built-in.o: In function `au0828_usb_probe':
> :(.text+0x114d08): undefined reference to `__v4l2_mc_usb_media_device_init'
> 
> This patch is one way out, by simply building the v4l2-mc.c file
> whenever at least one of VIDEO_V4L2 or DVB_CORE are enabled, including
> the case that one of them is a module and the other is built-in, which
> leads the MC code to become built-in as well.

Thanks for the patch, but I actually solved this issue the other way
around: I moved those functions to the media core, where both V4L and DVB
uses it. This also allows using the function outside (like on ALSA).

I should be pushing it later today to Linux next.

Regards,
Mauro

> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/media/Makefile           | 2 +-
>  drivers/media/v4l2-core/Makefile | 8 +++++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/Makefile b/drivers/media/Makefile
> index e608bbce0c35..16d471a56c0f 100644
> --- a/drivers/media/Makefile
> +++ b/drivers/media/Makefile
> @@ -19,7 +19,7 @@ ifeq ($(CONFIG_MEDIA_CONTROLLER),y)
>  endif
>  
>  obj-$(CONFIG_VIDEO_DEV) += v4l2-core/
> -obj-$(CONFIG_DVB_CORE)  += dvb-core/
> +obj-$(CONFIG_DVB_CORE)  += dvb-core/ v4l2-core/
>  
>  # There are both core and drivers at RC subtree - merge before drivers
>  obj-y += rc/
> diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
> index 795a5352761d..c26472f9950e 100644
> --- a/drivers/media/v4l2-core/Makefile
> +++ b/drivers/media/v4l2-core/Makefile
> @@ -16,7 +16,11 @@ endif
>  ifeq ($(CONFIG_TRACEPOINTS),y)
>    videodev-objs += vb2-trace.o v4l2-trace.o
>  endif
> -videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
> +
> +ifdef CONFIG_MEDIA_CONTROLLER
> +obj-$(CONFIG_VIDEO_V4L2) += v4l2-mc.o
> +obj-$(CONFIG_DVB_CORE) += v4l2-mc.o
> +endif
>  
>  obj-$(CONFIG_VIDEO_V4L2) += videodev.o
>  obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
> @@ -28,6 +32,7 @@ obj-$(CONFIG_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o
>  
>  obj-$(CONFIG_V4L2_FLASH_LED_CLASS) += v4l2-flash-led-class.o
>  
> +ifdef CONFIG_VIDEO_V4L2
>  obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o
>  obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o
>  obj-$(CONFIG_VIDEOBUF_DMA_CONTIG) += videobuf-dma-contig.o
> @@ -40,6 +45,7 @@ obj-$(CONFIG_VIDEOBUF2_VMALLOC) += videobuf2-vmalloc.o
>  obj-$(CONFIG_VIDEOBUF2_DMA_CONTIG) += videobuf2-dma-contig.o
>  obj-$(CONFIG_VIDEOBUF2_DMA_SG) += videobuf2-dma-sg.o
>  obj-$(CONFIG_VIDEOBUF2_DVB) += videobuf2-dvb.o
> +endif
>  
>  ccflags-y += -I$(srctree)/drivers/media/dvb-core
>  ccflags-y += -I$(srctree)/drivers/media/dvb-frontends


-- 
Thanks,
Mauro

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [media] v4l2/dvb: allow v4l2_mc functions to be used by dvb
  2016-03-03 17:29 ` Mauro Carvalho Chehab
@ 2016-03-04 15:37   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-03-04 15:37 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mauro Carvalho Chehab, Hans Verkuil, linux-kernel, linux-media

On Thursday 03 March 2016 14:29:53 Mauro Carvalho Chehab wrote:
> Em Sun, 28 Feb 2016 21:51:48 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> 
> > In a configuration that supports all DVB drivers but that disables
> > V4L2 or builds it as a loadable module, we get link errors because
> > of the recent change to use __v4l2_mc_usb_media_device_init:
> > 
> > drivers/media/built-in.o: In function `dvb_usb_adapter_dvb_init':
> > :(.text+0xe7966): undefined reference to `__v4l2_mc_usb_media_device_init'
> > drivers/media/built-in.o: In function `dvb_usbv2_init':
> > :(.text+0xff1cc): undefined reference to `__v4l2_mc_usb_media_device_init'
> > drivers/media/built-in.o: In function `smsusb_init_device':
> > :(.text+0x113be4): undefined reference to `__v4l2_mc_usb_media_device_init'
> > drivers/media/built-in.o: In function `au0828_usb_probe':
> > :(.text+0x114d08): undefined reference to `__v4l2_mc_usb_media_device_init'
> > 
> > This patch is one way out, by simply building the v4l2-mc.c file
> > whenever at least one of VIDEO_V4L2 or DVB_CORE are enabled, including
> > the case that one of them is a module and the other is built-in, which
> > leads the MC code to become built-in as well.
> 
> Thanks for the patch, but I actually solved this issue the other way
> around: I moved those functions to the media core, where both V4L and DVB
> uses it. This also allows using the function outside (like on ALSA).
> 
> I should be pushing it later today to Linux next.
> 
> 

Excellent! I was trying to come up with a better place for the code but
didn't know where else to put it.

	Arnd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-04 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-28 20:51 [PATCH] [media] v4l2/dvb: allow v4l2_mc functions to be used by dvb Arnd Bergmann
2016-03-03 17:29 ` Mauro Carvalho Chehab
2016-03-04 15:37   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox