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>
This commit is contained in:
@@ -1948,12 +1948,6 @@ int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
|
|||||||
|
|
||||||
em28xx_add_into_devlist(dev);
|
em28xx_add_into_devlist(dev);
|
||||||
|
|
||||||
errCode = em28xx_analog_config(dev);
|
|
||||||
if (errCode) {
|
|
||||||
em28xx_errdev("error configuring device\n");
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
retval = em28xx_register_analog_devices(dev);
|
retval = em28xx_register_analog_devices(dev);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
em28xx_release_resources(dev);
|
em28xx_release_resources(dev);
|
||||||
|
@@ -1950,8 +1950,10 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev,
|
|||||||
return vfd;
|
return vfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int em28xx_analog_config(struct em28xx *dev)
|
int em28xx_register_analog_devices(struct em28xx *dev)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n",
|
printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n",
|
||||||
dev->name,
|
dev->name,
|
||||||
(EM28XX_VERSION_CODE >> 16) & 0xff,
|
(EM28XX_VERSION_CODE >> 16) & 0xff,
|
||||||
@@ -1985,13 +1987,6 @@ int em28xx_analog_config(struct em28xx *dev)
|
|||||||
/* FIXME: This is a very bad hack! Not all devices have TV on input 2 */
|
/* FIXME: This is a very bad hack! Not all devices have TV on input 2 */
|
||||||
dev->ctl_input = 2;
|
dev->ctl_input = 2;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int em28xx_register_analog_devices(struct em28xx *dev)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* allocate and fill video video_device struct */
|
/* allocate and fill video video_device struct */
|
||||||
dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video");
|
dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video");
|
||||||
if (!dev->vdev) {
|
if (!dev->vdev) {
|
||||||
|
@@ -593,7 +593,6 @@ void em28xx_init_extension(struct em28xx *dev);
|
|||||||
void em28xx_close_extension(struct em28xx *dev);
|
void em28xx_close_extension(struct em28xx *dev);
|
||||||
|
|
||||||
/* Provided by em28xx-video.c */
|
/* Provided by em28xx-video.c */
|
||||||
int em28xx_analog_config(struct em28xx *dev);
|
|
||||||
int em28xx_register_analog_devices(struct em28xx *dev);
|
int em28xx_register_analog_devices(struct em28xx *dev);
|
||||||
void em28xx_release_analog_resources(struct em28xx *dev);
|
void em28xx_release_analog_resources(struct em28xx *dev);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user