diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-09-10 23:01:06 -0400 |
---|---|---|
committer | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-09-10 23:01:06 -0400 |
commit | 833b98d6daa6dfc535249b87dbc021704cdf08e4 (patch) | |
tree | d0de69a19d3862571b8e90d6a3322fe4889adb28 /linux/drivers/media/video/em28xx/em28xx-video.c | |
parent | f34b1cf00cddf45def1b83ac3b9ce9e09b12f3c8 (diff) | |
download | mediapointer-dvb-s2-833b98d6daa6dfc535249b87dbc021704cdf08e4.tar.gz mediapointer-dvb-s2-833b98d6daa6dfc535249b87dbc021704cdf08e4.tar.bz2 |
em28xx: do not create /dev/vbiX device if VBI not supported
From: Devin Heitmueller <dheitmueller@kernellabs.com>
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.
Priority: normal
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-video.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index 773016eb8..920712ae6 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -2557,14 +2557,17 @@ int em28xx_register_analog_devices(struct em28xx *dev) } /* Allocate and fill vbi video_device struct */ - dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, "vbi"); + if (em28xx_vbi_supported(dev) == 1) { + dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, + "vbi"); - /* register v4l2 vbi video_device */ - ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, - vbi_nr[dev->devno]); - if (ret < 0) { - em28xx_errdev("unable to register vbi device\n"); - return ret; + /* register v4l2 vbi video_device */ + ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, + vbi_nr[dev->devno]); + if (ret < 0) { + em28xx_errdev("unable to register vbi device\n"); + return ret; + } } if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { @@ -2584,8 +2587,12 @@ int em28xx_register_analog_devices(struct em28xx *dev) dev->radio_dev->num); } - em28xx_info("V4L2 device registered as /dev/video%d and /dev/vbi%d\n", - dev->vdev->num, dev->vbi_dev->num); + em28xx_info("V4L2 video device registered as /dev/video%d\n", + dev->vdev->num); + + if (dev->vbi_dev) + em28xx_info("V4L2 VBI device registered as /dev/vbi%d\n", + dev->vbi_dev->num); return 0; } |