Skip to contentSkip to conversation

uvcvideo: Fix build if !MEDIA_CONTROLLER

PATCH In review Thierry Reding 2 participants 2 messages Dec 29, 2015

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

PATCH 1/1 uvcvideo: Fix build if !MEDIA_CONTROLLER

From: Thierry Reding <[email protected]>

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 <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/usb/uvc/uvc_driver.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +2 -0
index 4dfd3eb814e7..fc63f9aae63e 100644
@@ -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);
Signature · 1 line
2.5.0
#1 lore raw

Hello Thierry,

Quoted 11 lines · Thierry Reding

From: Thierry Reding <[email protected]>

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 <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>

---

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,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America