diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-09-10 23:01:06 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 22:47:43 -0400 |
commit | 290c0cfac9050fa2442e93f35f47e4faa4227e85 (patch) | |
tree | 16cce12b818ca659a334d544720be80533657ba2 /drivers/media/video/em28xx/em28xx-video.c | |
parent | 365adee851ae8312e6d9e0ba6fdc6a98599e2778 (diff) |
V4L/DVB (12746): em28xx: do not create /dev/vbiX device if VBI not supported
Do not create the VBI device in cases where VBI is not supported on the target
em28xx chip.
This work was sponsored by EyeMagnet Limited.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 25 |
1 files changed, 16 insertions, 9 deletions
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 | } |