aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-06-22 01:38:37 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-28 14:09:10 -0400
commitae09e9e73a7d59bf0f8cc92e51c51abbd4cab732 (patch)
treee4dddd10c0bc0b39b59a209b20fe669813b05087 /drivers/media
parentf0a12d0c9272ae24491b983c4982acdacdac1baf (diff)
[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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/radio/wl128x/fmdrv.h2
-rw-r--r--drivers/media/radio/wl128x/fmdrv_v4l2.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/radio/wl128x/fmdrv.h b/drivers/media/radio/wl128x/fmdrv.h
index aac0f025f767..a587c9bac930 100644
--- a/drivers/media/radio/wl128x/fmdrv.h
+++ b/drivers/media/radio/wl128x/fmdrv.h
@@ -30,6 +30,7 @@
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <media/v4l2-ioctl.h> 31#include <media/v4l2-ioctl.h>
32#include <media/v4l2-common.h> 32#include <media/v4l2-common.h>
33#include <media/v4l2-device.h>
33#include <media/v4l2-ctrls.h> 34#include <media/v4l2-ctrls.h>
34 35
35#define FM_DRV_VERSION "0.1.1" 36#define FM_DRV_VERSION "0.1.1"
@@ -202,6 +203,7 @@ struct fmtx_data {
202/* FM driver operation structure */ 203/* FM driver operation structure */
203struct fmdev { 204struct fmdev {
204 struct video_device *radio_dev; /* V4L2 video device pointer */ 205 struct video_device *radio_dev; /* V4L2 video device pointer */
206 struct v4l2_device v4l2_dev; /* V4L2 top level struct */
205 struct snd_card *card; /* Card which holds FM mixer controls */ 207 struct snd_card *card; /* Card which holds FM mixer controls */
206 u16 asci_id; 208 u16 asci_id;
207 spinlock_t rds_buff_lock; /* To protect access to RDS buffer */ 209 spinlock_t rds_buff_lock; /* To protect access to RDS buffer */
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index 5dec323f4247..b55012c11842 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -533,6 +533,11 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
533 struct v4l2_ctrl *ctrl; 533 struct v4l2_ctrl *ctrl;
534 int ret; 534 int ret;
535 535
536 strlcpy(fmdev->v4l2_dev.name, FM_DRV_NAME, sizeof(fmdev->v4l2_dev.name));
537 ret = v4l2_device_register(NULL, &fmdev->v4l2_dev);
538 if (ret < 0)
539 return ret;
540
536 /* Init mutex for core locking */ 541 /* Init mutex for core locking */
537 mutex_init(&fmdev->mutex); 542 mutex_init(&fmdev->mutex);
538 543
@@ -549,6 +554,7 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
549 video_set_drvdata(gradio_dev, fmdev); 554 video_set_drvdata(gradio_dev, fmdev);
550 555
551 gradio_dev->lock = &fmdev->mutex; 556 gradio_dev->lock = &fmdev->mutex;
557 gradio_dev->v4l2_dev = &fmdev->v4l2_dev;
552 558
553 /* Register with V4L2 subsystem as RADIO device */ 559 /* Register with V4L2 subsystem as RADIO device */
554 if (video_register_device(gradio_dev, VFL_TYPE_RADIO, radio_nr)) { 560 if (video_register_device(gradio_dev, VFL_TYPE_RADIO, radio_nr)) {
@@ -611,5 +617,7 @@ void *fm_v4l2_deinit_video_device(void)
611 /* Unregister RADIO device from V4L2 subsystem */ 617 /* Unregister RADIO device from V4L2 subsystem */
612 video_unregister_device(gradio_dev); 618 video_unregister_device(gradio_dev);
613 619
620 v4l2_device_unregister(&fmdev->v4l2_dev);
621
614 return fmdev; 622 return fmdev;
615} 623}