summaryrefslogtreecommitdiff
path: root/drivers/media/radio/radio-si4713.c
diff options
context:
space:
mode:
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");