[media] tm6000: don't use BKL at the driver
Instead, use core lock handling. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Родитель
efba4bc12c
Коммит
dc961136b9
|
@ -909,8 +909,6 @@ static void tm6000_usb_disconnect(struct usb_interface *interface)
|
||||||
|
|
||||||
printk(KERN_INFO "tm6000: disconnecting %s\n", dev->name);
|
printk(KERN_INFO "tm6000: disconnecting %s\n", dev->name);
|
||||||
|
|
||||||
mutex_lock(&dev->lock);
|
|
||||||
|
|
||||||
tm6000_ir_fini(dev);
|
tm6000_ir_fini(dev);
|
||||||
|
|
||||||
if (dev->gpio.power_led) {
|
if (dev->gpio.power_led) {
|
||||||
|
@ -945,7 +943,6 @@ static void tm6000_usb_disconnect(struct usb_interface *interface)
|
||||||
tm6000_close_extension(dev);
|
tm6000_close_extension(dev);
|
||||||
tm6000_remove_from_devlist(dev);
|
tm6000_remove_from_devlist(dev);
|
||||||
|
|
||||||
mutex_unlock(&dev->lock);
|
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -313,10 +313,8 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
|
||||||
* beginning, we needed to add this hack. The better would be to
|
* beginning, we needed to add this hack. The better would be to
|
||||||
* discover some way to make tm6000 to wake up without this hack.
|
* discover some way to make tm6000 to wake up without this hack.
|
||||||
*/
|
*/
|
||||||
mutex_lock(&dev->lock);
|
|
||||||
f.frequency = dev->freq;
|
f.frequency = dev->freq;
|
||||||
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
|
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
|
||||||
mutex_unlock(&dev->lock);
|
|
||||||
|
|
||||||
msleep(100);
|
msleep(100);
|
||||||
tm6000_set_standard(dev, &dev->norm);
|
tm6000_set_standard(dev, &dev->norm);
|
||||||
|
|
|
@ -791,16 +791,11 @@ static struct videobuf_queue_ops tm6000_video_qops = {
|
||||||
static int res_get(struct tm6000_core *dev, struct tm6000_fh *fh)
|
static int res_get(struct tm6000_core *dev, struct tm6000_fh *fh)
|
||||||
{
|
{
|
||||||
/* is it free? */
|
/* is it free? */
|
||||||
mutex_lock(&dev->lock);
|
if (dev->resources)
|
||||||
if (dev->resources) {
|
|
||||||
/* no, someone else uses it */
|
|
||||||
mutex_unlock(&dev->lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
/* it's free, grab it */
|
/* it's free, grab it */
|
||||||
dev->resources =1;
|
dev->resources =1;
|
||||||
dprintk(dev, V4L2_DEBUG_RES_LOCK, "res: get\n");
|
dprintk(dev, V4L2_DEBUG_RES_LOCK, "res: get\n");
|
||||||
mutex_unlock(&dev->lock);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,10 +806,8 @@ static int res_locked(struct tm6000_core *dev)
|
||||||
|
|
||||||
static void res_free(struct tm6000_core *dev, struct tm6000_fh *fh)
|
static void res_free(struct tm6000_core *dev, struct tm6000_fh *fh)
|
||||||
{
|
{
|
||||||
mutex_lock(&dev->lock);
|
|
||||||
dev->resources = 0;
|
dev->resources = 0;
|
||||||
dprintk(dev, V4L2_DEBUG_RES_LOCK, "res: put\n");
|
dprintk(dev, V4L2_DEBUG_RES_LOCK, "res: put\n");
|
||||||
mutex_unlock(&dev->lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------
|
/* ------------------------------------------------------------------
|
||||||
|
@ -1229,10 +1222,8 @@ static int vidioc_s_frequency (struct file *file, void *priv,
|
||||||
if (unlikely(f->tuner != 0))
|
if (unlikely(f->tuner != 0))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
// mutex_lock(&dev->lock);
|
|
||||||
dev->freq = f->frequency;
|
dev->freq = f->frequency;
|
||||||
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, f);
|
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, f);
|
||||||
// mutex_unlock(&dev->lock);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1308,7 +1299,7 @@ static int tm6000_open(struct file *file)
|
||||||
NULL, &dev->slock,
|
NULL, &dev->slock,
|
||||||
fh->type,
|
fh->type,
|
||||||
V4L2_FIELD_INTERLACED,
|
V4L2_FIELD_INTERLACED,
|
||||||
sizeof(struct tm6000_buffer), fh, NULL);
|
sizeof(struct tm6000_buffer), fh, &dev->lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1389,7 +1380,7 @@ static struct v4l2_file_operations tm6000_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = tm6000_open,
|
.open = tm6000_open,
|
||||||
.release = tm6000_release,
|
.release = tm6000_release,
|
||||||
.ioctl = video_ioctl2, /* V4L2 ioctl handler */
|
.unlocked_ioctl = video_ioctl2, /* V4L2 ioctl handler */
|
||||||
.read = tm6000_read,
|
.read = tm6000_read,
|
||||||
.poll = tm6000_poll,
|
.poll = tm6000_poll,
|
||||||
.mmap = tm6000_mmap,
|
.mmap = tm6000_mmap,
|
||||||
|
@ -1451,8 +1442,10 @@ int tm6000_v4l2_register(struct tm6000_core *dev)
|
||||||
INIT_LIST_HEAD(&dev->vidq.active);
|
INIT_LIST_HEAD(&dev->vidq.active);
|
||||||
INIT_LIST_HEAD(&dev->vidq.queued);
|
INIT_LIST_HEAD(&dev->vidq.queued);
|
||||||
|
|
||||||
memcpy (dev->vfd, &tm6000_template, sizeof(*(dev->vfd)));
|
memcpy(dev->vfd, &tm6000_template, sizeof(*(dev->vfd)));
|
||||||
dev->vfd->debug=tm6000_debug;
|
dev->vfd->debug = tm6000_debug;
|
||||||
|
dev->vfd->lock = &dev->lock;
|
||||||
|
|
||||||
vfd->v4l2_dev = &dev->v4l2_dev;
|
vfd->v4l2_dev = &dev->v4l2_dev;
|
||||||
video_set_drvdata(vfd, dev);
|
video_set_drvdata(vfd, dev);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче