mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 23:34:05 +08:00
[media] wl128x: add missing struct v4l2_device
This struct is now required for all video device nodes, but it was missing in this driver. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
f0a12d0c92
commit
ae09e9e73a
@ -30,6 +30,7 @@
|
||||
#include <linux/timer.h>
|
||||
#include <media/v4l2-ioctl.h>
|
||||
#include <media/v4l2-common.h>
|
||||
#include <media/v4l2-device.h>
|
||||
#include <media/v4l2-ctrls.h>
|
||||
|
||||
#define FM_DRV_VERSION "0.1.1"
|
||||
@ -202,6 +203,7 @@ struct fmtx_data {
|
||||
/* FM driver operation structure */
|
||||
struct fmdev {
|
||||
struct video_device *radio_dev; /* V4L2 video device pointer */
|
||||
struct v4l2_device v4l2_dev; /* V4L2 top level struct */
|
||||
struct snd_card *card; /* Card which holds FM mixer controls */
|
||||
u16 asci_id;
|
||||
spinlock_t rds_buff_lock; /* To protect access to RDS buffer */
|
||||
|
@ -533,6 +533,11 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
|
||||
struct v4l2_ctrl *ctrl;
|
||||
int ret;
|
||||
|
||||
strlcpy(fmdev->v4l2_dev.name, FM_DRV_NAME, sizeof(fmdev->v4l2_dev.name));
|
||||
ret = v4l2_device_register(NULL, &fmdev->v4l2_dev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Init mutex for core locking */
|
||||
mutex_init(&fmdev->mutex);
|
||||
|
||||
@ -549,6 +554,7 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
|
||||
video_set_drvdata(gradio_dev, fmdev);
|
||||
|
||||
gradio_dev->lock = &fmdev->mutex;
|
||||
gradio_dev->v4l2_dev = &fmdev->v4l2_dev;
|
||||
|
||||
/* Register with V4L2 subsystem as RADIO device */
|
||||
if (video_register_device(gradio_dev, VFL_TYPE_RADIO, radio_nr)) {
|
||||
@ -611,5 +617,7 @@ void *fm_v4l2_deinit_video_device(void)
|
||||
/* Unregister RADIO device from V4L2 subsystem */
|
||||
video_unregister_device(gradio_dev);
|
||||
|
||||
v4l2_device_unregister(&fmdev->v4l2_dev);
|
||||
|
||||
return fmdev;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user