[media] v4l2-dev: add flag to have the core lock all file operations
[firefly-linux-kernel-4.4.55.git] / drivers / media / radio / wl128x / fmdrv_v4l2.c
index 077d369a017318e40849466c92bea074c94b46c1..080b96a61f1a41783e8d7025e63722fb94ceeb0e 100644 (file)
@@ -518,6 +518,10 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
        video_set_drvdata(gradio_dev, fmdev);
 
        gradio_dev->lock = &fmdev->mutex;
+       /* Locking in file operations other than ioctl should be done
+          by the driver, not the V4L2 core.
+          This driver needs auditing so that this flag can be removed. */
+       set_bit(V4L2_FL_LOCK_ALL_FOPS, &gradio_dev->flags);
 
        /* Register with V4L2 subsystem as RADIO device */
        if (video_register_device(gradio_dev, VFL_TYPE_RADIO, radio_nr)) {