]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[media] cx18: convert to unlocked_ioctl
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 19 Nov 2010 20:04:31 +0000 (17:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 1 Dec 2010 22:10:16 +0000 (20:10 -0200)
Also added locking around snd_cx18_pcm_ioctl as a precaution
as requested by Andy Walls.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx18/cx18-alsa-pcm.c
drivers/media/video/cx18/cx18-streams.c

index 8f55692db36d278e01191bd3fd2ea9e380c90965..82d195be91976ad18ae3cb9059e64efcf2c44788 100644 (file)
@@ -218,7 +218,13 @@ static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream)
 static int snd_cx18_pcm_ioctl(struct snd_pcm_substream *substream,
                     unsigned int cmd, void *arg)
 {
-       return snd_pcm_lib_ioctl(substream, cmd, arg);
+       struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream);
+       int ret;
+
+       snd_cx18_lock(cxsc);
+       ret = snd_pcm_lib_ioctl(substream, cmd, arg);
+       snd_cx18_unlock(cxsc);
+       return ret;
 }
 
 
index 9045f1ece0ebb35cdb1b85eec68b96cc2344fcfc..ab461e27d9dd1ad6206e9054f391605556563a74 100644 (file)
@@ -41,7 +41,7 @@ static struct v4l2_file_operations cx18_v4l2_enc_fops = {
        .read = cx18_v4l2_read,
        .open = cx18_v4l2_open,
        /* FIXME change to video_ioctl2 if serialization lock can be removed */
-       .ioctl = cx18_v4l2_ioctl,
+       .unlocked_ioctl = cx18_v4l2_ioctl,
        .release = cx18_v4l2_close,
        .poll = cx18_v4l2_enc_poll,
 };