summaryrefslogtreecommitdiff
path: root/drivers/media/radio/radio-si4713.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-04-08 06:31:30 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-14 19:52:56 -0300
commit55b2a312c29695520f813e61d668318169895ba7 (patch)
tree75ed8a62d98b0dc0e01048ade3e4f93de357c8c7 /drivers/media/radio/radio-si4713.c
parenta58841d0dcb79aebc558a1b55d29995f62aa61a4 (diff)
[media] radio-si4713: use V4L2 core lock
Simplify locking by using the V4L2 core lock mechanism. This allows us to remove all locking from the i2c module. This will also simplify the upcoming conversion to the control framework. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Eduardo Valentin <edubezval@gmail.com> Tested-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-si4713.c')
-rw-r--r--drivers/media/radio/radio-si4713.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
index f0f0a90c69ed..633c545438f7 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -49,6 +49,7 @@ MODULE_ALIAS("platform:radio-si4713");
struct radio_si4713_device {
struct v4l2_device v4l2_dev;
struct video_device radio_dev;
+ struct mutex lock;
};
/* radio_si4713_fops - file operations interface */
@@ -247,6 +248,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev)
rval = -ENOMEM;
goto exit;
}
+ mutex_init(&rsdev->lock);
rval = v4l2_device_register(&pdev->dev, &rsdev->v4l2_dev);
if (rval) {
@@ -272,6 +274,8 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev)
rsdev->radio_dev = radio_si4713_vdev_template;
rsdev->radio_dev.v4l2_dev = &rsdev->v4l2_dev;
+ /* Serialize all access to the si4713 */
+ rsdev->radio_dev.lock = &rsdev->lock;
video_set_drvdata(&rsdev->radio_dev, rsdev);
if (video_register_device(&rsdev->radio_dev, VFL_TYPE_RADIO, radio_nr)) {
dev_err(&pdev->dev, "Could not register video device.\n");