[media] BKL: trivial BKL removal from V4L2 radio drivers
The patch converts a bunch of V4L2 radio drivers to unlocked_ioctl. These are all simple conversions: most already had a lock and so the ioctl fop could simply be replaced by unlocked_ioctl. radio-miropcm20.c was converted to use the new V4L2 core lock. While doing this work I noticed that many of these drivers initialized some more fields or muted audio or something like that *after* creating the device node. This should be done before the device node is created to prevent problems. Especially hal tends to grab a device node as soon as it is created. In one or two cases the mutex_init was even done after the device creation! Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
e53beacd23
commit
32958fdd16
@@ -324,7 +324,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
|
||||
|
||||
static const struct v4l2_file_operations aztech_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = video_ioctl2,
|
||||
.unlocked_ioctl = video_ioctl2,
|
||||
};
|
||||
|
||||
static const struct v4l2_ioctl_ops aztech_ioctl_ops = {
|
||||
@@ -375,6 +375,8 @@ static int __init aztech_init(void)
|
||||
az->vdev.ioctl_ops = &aztech_ioctl_ops;
|
||||
az->vdev.release = video_device_release_empty;
|
||||
video_set_drvdata(&az->vdev, az);
|
||||
/* mute card - prevents noisy bootups */
|
||||
outb(0, az->io);
|
||||
|
||||
if (video_register_device(&az->vdev, VFL_TYPE_RADIO, radio_nr) < 0) {
|
||||
v4l2_device_unregister(v4l2_dev);
|
||||
@@ -383,8 +385,6 @@ static int __init aztech_init(void)
|
||||
}
|
||||
|
||||
v4l2_info(v4l2_dev, "Aztech radio card driver v1.00/19990224 rkroll@exploits.org\n");
|
||||
/* mute card - prevents noisy bootups */
|
||||
outb(0, az->io);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user