From 65bbf0e648291aa79c956b9b38adc0627c9759dd Mon Sep 17 00:00:00 2001 From: Holger Waechtler Date: Fri, 3 Dec 2004 09:10:57 +0000 Subject: SET_PARAMETER locking and some event compatibility code for VDR. Thanks to Stefan Lucke for reporting this --- linux/drivers/media/dvb/cinergyT2/cinergyT2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c index eef2de260..9a69568a2 100644 --- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c @@ -587,15 +587,24 @@ static int cinergyt2_ioctl (struct inode *inode, struct file *file, if (copy_from_user(&p, (void *) arg, sizeof(p))) return -EFAULT; + if (down_interruptible(&cinergyt2->sem)) + return -ERESTARTSYS; + param->cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS; param->tps = cpu_to_le16(compute_tps(&p)); param->freq = cpu_to_le32(p.frequency / 1000); param->bandwidth = 8 - p.u.ofdm.bandwidth - BANDWIDTH_8_MHZ; + stat->lock_bits = 0; + cinergyt2->pending_fe_events++; + wake_up_interruptible(&cinergyt2->poll_wq); + err = cinergyt2_command(cinergyt2, (char *) param, sizeof(*param), NULL, 0); + up(&cinergyt2->sem); + return (err < 0) ? err : 0; } @@ -608,6 +617,7 @@ static int cinergyt2_ioctl (struct inode *inode, struct file *file, * functionality. */ break; + case FE_GET_EVENT: { /** -- cgit v1.2.3