pci_release_regions(pdev);
pci_disable_device(pdev);
+ v4l2_device_unregister(&solo_dev->v4l2_dev);
pci_set_drvdata(pdev, NULL);
kfree(solo_dev);
solo_dev->type = id->driver_data;
solo_dev->pdev = pdev;
spin_lock_init(&solo_dev->reg_io_lock);
- pci_set_drvdata(pdev, solo_dev);
+ ret = v4l2_device_register(&pdev->dev, &solo_dev->v4l2_dev);
+ if (ret)
+ goto fail_probe;
/* Only for during init */
solo_dev->p2m_jiffies = msecs_to_jiffies(100);
static void solo_pci_remove(struct pci_dev *pdev)
{
- struct solo_dev *solo_dev = pci_get_drvdata(pdev);
+ struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev);
+ struct solo_dev *solo_dev = container_of(v4l2_dev, struct solo_dev, v4l2_dev);
free_solo_dev(solo_dev);
}
#include <linux/videodev2.h>
#include <media/v4l2-dev.h>
+#include <media/v4l2-device.h>
#include <media/videobuf-core.h>
#include "registers.h"
u32 irq_mask;
u32 motion_mask;
spinlock_t reg_io_lock;
+ struct v4l2_device v4l2_dev;
/* tw28xx accounting */
u8 tw2865, tw2864, tw2815;
solo_enc->ch = ch;
*solo_enc->vfd = solo_enc_template;
- solo_enc->vfd->parent = &solo_dev->pdev->dev;
+ solo_enc->vfd->v4l2_dev = &solo_dev->v4l2_dev;
ret = video_register_device(solo_enc->vfd, VFL_TYPE_GRABBER, nr);
if (ret < 0) {
video_device_release(solo_enc->vfd);
return -ENOMEM;
*solo_dev->vfd = solo_v4l2_template;
- solo_dev->vfd->parent = &solo_dev->pdev->dev;
+ solo_dev->vfd->v4l2_dev = &solo_dev->v4l2_dev;
ret = video_register_device(solo_dev->vfd, VFL_TYPE_GRABBER, nr);
if (ret < 0) {