summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2017-08-08 14:56:23 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-20 14:09:32 +0200
commit9d15cd958c172c8b02da6ee28638ccbbf7933175 (patch)
treeae5c95757ab996083c78c45887c91f75ec62e5fb /drivers/media/usb/uvc/uvcvideo.h
parentmedia: uvcvideo: Fix .queue_setup() to check the number of planes (diff)
downloadlinux-9d15cd958c172c8b02da6ee28638ccbbf7933175.tar.xz
linux-9d15cd958c172c8b02da6ee28638ccbbf7933175.zip
media: uvcvideo: Convert from using an atomic variable to a reference count
When adding support for metadata nodes, we'll have to keep video devices registered until all metadata nodes are closed too. Since this has nothing to do with stream counting, replace the nstreams atomic variable with a reference counter. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/uvc/uvcvideo.h')
-rw-r--r--drivers/media/usb/uvc/uvcvideo.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 296b69bb3fb2..34c7ee6cc9e5 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -575,7 +575,7 @@ struct uvc_device {
/* Video Streaming interfaces */
struct list_head streams;
- atomic_t nstreams;
+ struct kref ref;
/* Status Interrupt Endpoint */
struct usb_host_endpoint *int_ep;