linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] uvcvideo: Fix build if !MEDIA_CONTROLLER
@ 2015-12-29 10:30 Thierry Reding
  2015-12-29 12:22 ` Javier Martinez Canillas
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Reding @ 2015-12-29 10:30 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media, linux-kernel, Javier Martinez Canillas,
	Mauro Carvalho Chehab

From: Thierry Reding <treding@nvidia.com>

Accesses to the UVC device's mdev field need to be protected by a
preprocessor conditional to avoid build errors, since the field is only
included if the MEDIA_CONTROLLER option is selected.

Fixes: 1590ad7b5271 ("[media] media-device: split media initialization and registration")
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 4dfd3eb814e7..fc63f9aae63e 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1937,9 +1937,11 @@ static int uvc_probe(struct usb_interface *intf,
 	if (uvc_register_chains(dev) < 0)
 		goto error;
 
+#ifdef CONFIG_MEDIA_CONTROLLER
 	/* Register the media device node */
 	if (media_device_register(&dev->mdev) < 0)
 		goto error;
+#endif
 
 	/* Save our data pointer in the interface data. */
 	usb_set_intfdata(intf, dev);
-- 
2.5.0


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

* Re: [PATCH] [media] uvcvideo: Fix build if !MEDIA_CONTROLLER
  2015-12-29 10:30 [PATCH] [media] uvcvideo: Fix build if !MEDIA_CONTROLLER Thierry Reding
@ 2015-12-29 12:22 ` Javier Martinez Canillas
  0 siblings, 0 replies; 2+ messages in thread
From: Javier Martinez Canillas @ 2015-12-29 12:22 UTC (permalink / raw)
  To: Thierry Reding, Laurent Pinchart
  Cc: linux-media, linux-kernel, Mauro Carvalho Chehab

Hello Thierry,

On 12/29/2015 07:30 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Accesses to the UVC device's mdev field need to be protected by a
> preprocessor conditional to avoid build errors, since the field is only
> included if the MEDIA_CONTROLLER option is selected.
> 
> Fixes: 1590ad7b5271 ("[media] media-device: split media initialization and registration")
> Cc: Javier Martinez Canillas <javier@osg.samsung.com>
> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---

Thanks for the patch but I've already posted the same fix a couple of
days ago [0]. Since the offending commit still has not landed in
mainline, Mauro squashed the fixes with the original commit and will
refresh his next branch soon.

[0]: https://lkml.org/lkml/2015/12/21/224

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

end of thread, other threads:[~2015-12-29 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 10:30 [PATCH] [media] uvcvideo: Fix build if !MEDIA_CONTROLLER Thierry Reding
2015-12-29 12:22 ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).