diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-28 20:26:36 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:39:38 -0500 |
commit | 2e5ef2dfc45ff1ecebb0d8657b85b3fc716db9bf (patch) | |
tree | 5f1c88218a36e1cd029dbc7c50750a592d91a8c5 /drivers/media | |
parent | 1a23f81b7dc3115b29cff0e4f58b5dd04a6242ad (diff) |
V4L/DVB (9980): em28xx: simplify analog logic
Now, just two routines are enough for analog: the first one configs the analog
part and register V4L2 devices, and the second one release analog devices.
After this patch, it will be easier to transform em28xx-video into an em28xx
extension, loaded only on analog devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 6 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 11 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 1 |
3 files changed, 3 insertions, 15 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 42978f9592b7..3759f3a56cb7 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -1948,12 +1948,6 @@ int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1948 | 1948 | ||
1949 | em28xx_add_into_devlist(dev); | 1949 | em28xx_add_into_devlist(dev); |
1950 | 1950 | ||
1951 | errCode = em28xx_analog_config(dev); | ||
1952 | if (errCode) { | ||
1953 | em28xx_errdev("error configuring device\n"); | ||
1954 | return -ENOMEM; | ||
1955 | } | ||
1956 | |||
1957 | retval = em28xx_register_analog_devices(dev); | 1951 | retval = em28xx_register_analog_devices(dev); |
1958 | if (retval < 0) { | 1952 | if (retval < 0) { |
1959 | em28xx_release_resources(dev); | 1953 | em28xx_release_resources(dev); |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 4c0986920970..4a548fbd79d3 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1950,8 +1950,10 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev, | |||
1950 | return vfd; | 1950 | return vfd; |
1951 | } | 1951 | } |
1952 | 1952 | ||
1953 | int em28xx_analog_config(struct em28xx *dev) | 1953 | int em28xx_register_analog_devices(struct em28xx *dev) |
1954 | { | 1954 | { |
1955 | int ret; | ||
1956 | |||
1955 | printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n", | 1957 | printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n", |
1956 | dev->name, | 1958 | dev->name, |
1957 | (EM28XX_VERSION_CODE >> 16) & 0xff, | 1959 | (EM28XX_VERSION_CODE >> 16) & 0xff, |
@@ -1985,13 +1987,6 @@ int em28xx_analog_config(struct em28xx *dev) | |||
1985 | /* FIXME: This is a very bad hack! Not all devices have TV on input 2 */ | 1987 | /* FIXME: This is a very bad hack! Not all devices have TV on input 2 */ |
1986 | dev->ctl_input = 2; | 1988 | dev->ctl_input = 2; |
1987 | 1989 | ||
1988 | return 0; | ||
1989 | } | ||
1990 | |||
1991 | int em28xx_register_analog_devices(struct em28xx *dev) | ||
1992 | { | ||
1993 | int ret; | ||
1994 | |||
1995 | /* allocate and fill video video_device struct */ | 1990 | /* allocate and fill video video_device struct */ |
1996 | dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video"); | 1991 | dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video"); |
1997 | if (!dev->vdev) { | 1992 | if (!dev->vdev) { |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index c8e71edbfea7..58a3675abb62 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -593,7 +593,6 @@ void em28xx_init_extension(struct em28xx *dev); | |||
593 | void em28xx_close_extension(struct em28xx *dev); | 593 | void em28xx_close_extension(struct em28xx *dev); |
594 | 594 | ||
595 | /* Provided by em28xx-video.c */ | 595 | /* Provided by em28xx-video.c */ |
596 | int em28xx_analog_config(struct em28xx *dev); | ||
597 | int em28xx_register_analog_devices(struct em28xx *dev); | 596 | int em28xx_register_analog_devices(struct em28xx *dev); |
598 | void em28xx_release_analog_resources(struct em28xx *dev); | 597 | void em28xx_release_analog_resources(struct em28xx *dev); |
599 | 598 | ||