diff options
Diffstat (limited to 'include/media/v4l2-dev.h')
-rw-r--r-- | include/media/v4l2-dev.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 15802a067a12..4fe6831b1851 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -21,7 +21,8 @@ | |||
21 | #define VFL_TYPE_GRABBER 0 | 21 | #define VFL_TYPE_GRABBER 0 |
22 | #define VFL_TYPE_VBI 1 | 22 | #define VFL_TYPE_VBI 1 |
23 | #define VFL_TYPE_RADIO 2 | 23 | #define VFL_TYPE_RADIO 2 |
24 | #define VFL_TYPE_MAX 3 | 24 | #define VFL_TYPE_SUBDEV 3 |
25 | #define VFL_TYPE_MAX 4 | ||
25 | 26 | ||
26 | struct v4l2_ioctl_callbacks; | 27 | struct v4l2_ioctl_callbacks; |
27 | struct video_device; | 28 | struct video_device; |
@@ -102,15 +103,26 @@ struct video_device | |||
102 | /* dev to video-device */ | 103 | /* dev to video-device */ |
103 | #define to_video_device(cd) container_of(cd, struct video_device, dev) | 104 | #define to_video_device(cd) container_of(cd, struct video_device, dev) |
104 | 105 | ||
106 | int __must_check __video_register_device(struct video_device *vdev, int type, | ||
107 | int nr, int warn_if_nr_in_use, struct module *owner); | ||
108 | |||
105 | /* Register video devices. Note that if video_register_device fails, | 109 | /* Register video devices. Note that if video_register_device fails, |
106 | the release() callback of the video_device structure is *not* called, so | 110 | the release() callback of the video_device structure is *not* called, so |
107 | the caller is responsible for freeing any data. Usually that means that | 111 | the caller is responsible for freeing any data. Usually that means that |
108 | you call video_device_release() on failure. */ | 112 | you call video_device_release() on failure. */ |
109 | int __must_check video_register_device(struct video_device *vdev, int type, int nr); | 113 | static inline int __must_check video_register_device(struct video_device *vdev, |
114 | int type, int nr) | ||
115 | { | ||
116 | return __video_register_device(vdev, type, nr, 1, vdev->fops->owner); | ||
117 | } | ||
110 | 118 | ||
111 | /* Same as video_register_device, but no warning is issued if the desired | 119 | /* Same as video_register_device, but no warning is issued if the desired |
112 | device node number was already in use. */ | 120 | device node number was already in use. */ |
113 | int __must_check video_register_device_no_warn(struct video_device *vdev, int type, int nr); | 121 | static inline int __must_check video_register_device_no_warn( |
122 | struct video_device *vdev, int type, int nr) | ||
123 | { | ||
124 | return __video_register_device(vdev, type, nr, 0, vdev->fops->owner); | ||
125 | } | ||
114 | 126 | ||
115 | /* Unregister video devices. Will do nothing if vdev == NULL or | 127 | /* Unregister video devices. Will do nothing if vdev == NULL or |
116 | video_is_registered() returns false. */ | 128 | video_is_registered() returns false. */ |