dev->vdev = stk_v4l_data;
dev->vdev.debug = debug;
- dev->vdev.parent = &dev->interface->dev;
+ dev->vdev.v4l2_dev = &dev->v4l2_dev;
err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1);
if (err)
STK_ERROR("v4l registration failed\n");
STK_ERROR("Out of memory !\n");
return -ENOMEM;
}
+ err = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
+ if (err < 0) {
+ dev_err(&udev->dev, "couldn't register v4l2_device\n");
+ kfree(dev);
+ return err;
+ }
spin_lock_init(&dev->spinlock);
init_waitqueue_head(&dev->wait_frame);
return 0;
error:
+ v4l2_device_unregister(&dev->v4l2_dev);
kfree(dev);
return err;
}
video_device_node_name(&dev->vdev));
video_unregister_device(&dev->vdev);
+ v4l2_device_unregister(&dev->v4l2_dev);
}
#ifdef CONFIG_PM
#define STKWEBCAM_H
#include <linux/usb.h>
+#include <media/v4l2-device.h>
#include <media/v4l2-common.h>
#define DRIVER_VERSION "v0.0.1"
};
struct stk_camera {
+ struct v4l2_device v4l2_dev;
struct video_device vdev;
struct usb_device *udev;
struct usb_interface *interface;