diff options
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-video.c')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-video.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c index 71e152dc2791..3fc7a6fe8554 100644 --- a/drivers/media/video/cx231xx/cx231xx-video.c +++ b/drivers/media/video/cx231xx/cx231xx-video.c | |||
@@ -1918,13 +1918,22 @@ static int cx231xx_v4l2_open(struct file *filp) | |||
1918 | { | 1918 | { |
1919 | int minor = video_devdata(filp)->minor; | 1919 | int minor = video_devdata(filp)->minor; |
1920 | int errCode = 0, radio = 0; | 1920 | int errCode = 0, radio = 0; |
1921 | struct cx231xx *dev = NULL; | 1921 | struct video_device *vdev = video_devdata(filp); |
1922 | struct cx231xx *dev = video_drvdata(filp); | ||
1922 | struct cx231xx_fh *fh; | 1923 | struct cx231xx_fh *fh; |
1923 | enum v4l2_buf_type fh_type = 0; | 1924 | enum v4l2_buf_type fh_type = 0; |
1924 | 1925 | ||
1925 | dev = cx231xx_get_device(minor, &fh_type, &radio); | 1926 | switch (vdev->vfl_type) { |
1926 | if (NULL == dev) | 1927 | case VFL_TYPE_GRABBER: |
1927 | return -ENODEV; | 1928 | fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
1929 | break; | ||
1930 | case VFL_TYPE_VBI: | ||
1931 | fh_type = V4L2_BUF_TYPE_VBI_CAPTURE; | ||
1932 | break; | ||
1933 | case VFL_TYPE_RADIO: | ||
1934 | radio = 1; | ||
1935 | break; | ||
1936 | } | ||
1928 | 1937 | ||
1929 | mutex_lock(&dev->lock); | 1938 | mutex_lock(&dev->lock); |
1930 | 1939 | ||
@@ -2326,6 +2335,7 @@ static struct video_device *cx231xx_vdev_init(struct cx231xx *dev, | |||
2326 | 2335 | ||
2327 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); | 2336 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); |
2328 | 2337 | ||
2338 | video_set_drvdata(vfd, dev); | ||
2329 | return vfd; | 2339 | return vfd; |
2330 | } | 2340 | } |
2331 | 2341 | ||