diff options
-rw-r--r-- | drivers/media/video/em28xx/em28xx-core.c | 2 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 25 |
2 files changed, 17 insertions, 10 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 3128b7fce07d..a88257a7d94f 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c | |||
@@ -1131,7 +1131,7 @@ struct em28xx *em28xx_get_device(int minor, | |||
1131 | list_for_each_entry(h, &em28xx_devlist, devlist) { | 1131 | list_for_each_entry(h, &em28xx_devlist, devlist) { |
1132 | if (h->vdev->minor == minor) | 1132 | if (h->vdev->minor == minor) |
1133 | dev = h; | 1133 | dev = h; |
1134 | if (h->vbi_dev->minor == minor) { | 1134 | if (h->vbi_dev && h->vbi_dev->minor == minor) { |
1135 | dev = h; | 1135 | dev = h; |
1136 | *fh_type = V4L2_BUF_TYPE_VBI_CAPTURE; | 1136 | *fh_type = V4L2_BUF_TYPE_VBI_CAPTURE; |
1137 | } | 1137 | } |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index dda4a76dcaba..a5632c7e6438 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -2504,14 +2504,17 @@ int em28xx_register_analog_devices(struct em28xx *dev) | |||
2504 | } | 2504 | } |
2505 | 2505 | ||
2506 | /* Allocate and fill vbi video_device struct */ | 2506 | /* Allocate and fill vbi video_device struct */ |
2507 | dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, "vbi"); | 2507 | if (em28xx_vbi_supported(dev) == 1) { |
2508 | dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, | ||
2509 | "vbi"); | ||
2508 | 2510 | ||
2509 | /* register v4l2 vbi video_device */ | 2511 | /* register v4l2 vbi video_device */ |
2510 | ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, | 2512 | ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, |
2511 | vbi_nr[dev->devno]); | 2513 | vbi_nr[dev->devno]); |
2512 | if (ret < 0) { | 2514 | if (ret < 0) { |
2513 | em28xx_errdev("unable to register vbi device\n"); | 2515 | em28xx_errdev("unable to register vbi device\n"); |
2514 | return ret; | 2516 | return ret; |
2517 | } | ||
2515 | } | 2518 | } |
2516 | 2519 | ||
2517 | if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { | 2520 | if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { |
@@ -2531,8 +2534,12 @@ int em28xx_register_analog_devices(struct em28xx *dev) | |||
2531 | dev->radio_dev->num); | 2534 | dev->radio_dev->num); |
2532 | } | 2535 | } |
2533 | 2536 | ||
2534 | em28xx_info("V4L2 device registered as /dev/video%d and /dev/vbi%d\n", | 2537 | em28xx_info("V4L2 video device registered as /dev/video%d\n", |
2535 | dev->vdev->num, dev->vbi_dev->num); | 2538 | dev->vdev->num); |
2539 | |||
2540 | if (dev->vbi_dev) | ||
2541 | em28xx_info("V4L2 VBI device registered as /dev/vbi%d\n", | ||
2542 | dev->vbi_dev->num); | ||
2536 | 2543 | ||
2537 | return 0; | 2544 | return 0; |
2538 | } | 2545 | } |