diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx18/cx18-streams.c | 4 | ||||
-rw-r--r-- | drivers/media/video/videodev.c | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c index f3d20509a8b..1728b1d832a 100644 --- a/drivers/media/video/cx18/cx18-streams.c +++ b/drivers/media/video/cx18/cx18-streams.c | |||
@@ -311,8 +311,10 @@ void cx18_streams_cleanup(struct cx18 *cx, int unregister) | |||
311 | 311 | ||
312 | /* Teardown all streams */ | 312 | /* Teardown all streams */ |
313 | for (type = 0; type < CX18_MAX_STREAMS; type++) { | 313 | for (type = 0; type < CX18_MAX_STREAMS; type++) { |
314 | if (cx->streams[type].dvb.enabled) | 314 | if (cx->streams[type].dvb.enabled) { |
315 | cx18_dvb_unregister(&cx->streams[type]); | 315 | cx18_dvb_unregister(&cx->streams[type]); |
316 | cx->streams[type].dvb.enabled = false; | ||
317 | } | ||
316 | 318 | ||
317 | vdev = cx->streams[type].v4l2dev; | 319 | vdev = cx->streams[type].v4l2dev; |
318 | 320 | ||
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index aca36dec674..6616e657055 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -2023,7 +2023,7 @@ EXPORT_SYMBOL(video_ioctl2); | |||
2023 | static int get_index(struct video_device *vdev, int num) | 2023 | static int get_index(struct video_device *vdev, int num) |
2024 | { | 2024 | { |
2025 | u32 used = 0; | 2025 | u32 used = 0; |
2026 | const unsigned max_index = sizeof(used) * 8 - 1; | 2026 | const int max_index = sizeof(used) * 8 - 1; |
2027 | int i; | 2027 | int i; |
2028 | 2028 | ||
2029 | /* Currently a single v4l driver instance cannot create more than | 2029 | /* Currently a single v4l driver instance cannot create more than |
@@ -2145,14 +2145,15 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, | |||
2145 | vfd->minor=i; | 2145 | vfd->minor=i; |
2146 | 2146 | ||
2147 | ret = get_index(vfd, index); | 2147 | ret = get_index(vfd, index); |
2148 | vfd->index = ret; | ||
2149 | |||
2150 | mutex_unlock(&videodev_lock); | ||
2151 | |||
2148 | if (ret < 0) { | 2152 | if (ret < 0) { |
2149 | printk(KERN_ERR "%s: get_index failed\n", __func__); | 2153 | printk(KERN_ERR "%s: get_index failed\n", __func__); |
2150 | goto fail_minor; | 2154 | goto fail_minor; |
2151 | } | 2155 | } |
2152 | 2156 | ||
2153 | vfd->index = ret; | ||
2154 | |||
2155 | mutex_unlock(&videodev_lock); | ||
2156 | mutex_init(&vfd->lock); | 2157 | mutex_init(&vfd->lock); |
2157 | 2158 | ||
2158 | /* sysfs class */ | 2159 | /* sysfs class */ |