Commit 1e56243f authored by Thomas Gleixner's avatar Thomas Gleixner

media/dvb: Convert to anon_semaphore

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 2554c41d
...@@ -101,7 +101,7 @@ struct dvb_frontend_private { ...@@ -101,7 +101,7 @@ struct dvb_frontend_private {
struct dvb_device *dvbdev; struct dvb_device *dvbdev;
struct dvb_frontend_parameters parameters; struct dvb_frontend_parameters parameters;
struct dvb_fe_events events; struct dvb_fe_events events;
struct semaphore sem; struct anon_semaphore sem;
struct list_head list_head; struct list_head list_head;
wait_queue_head_t wait_queue; wait_queue_head_t wait_queue;
struct task_struct *thread; struct task_struct *thread;
...@@ -189,12 +189,12 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe, ...@@ -189,12 +189,12 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe,
if (flags & O_NONBLOCK) if (flags & O_NONBLOCK)
return -EWOULDBLOCK; return -EWOULDBLOCK;
up(&fepriv->sem); anon_up(&fepriv->sem);
ret = wait_event_interruptible (events->wait_queue, ret = wait_event_interruptible (events->wait_queue,
events->eventw != events->eventr); events->eventw != events->eventr);
if (down_interruptible (&fepriv->sem)) if (anon_down_interruptible (&fepriv->sem))
return -ERESTARTSYS; return -ERESTARTSYS;
if (ret < 0) if (ret < 0)
...@@ -534,7 +534,7 @@ static int dvb_frontend_thread(void *data) ...@@ -534,7 +534,7 @@ static int dvb_frontend_thread(void *data)
set_freezable(); set_freezable();
while (1) { while (1) {
up(&fepriv->sem); /* is locked when we enter the thread... */ anon_up(&fepriv->sem); /* is locked when we enter the thread... */
restart: restart:
timeout = wait_event_interruptible_timeout(fepriv->wait_queue, timeout = wait_event_interruptible_timeout(fepriv->wait_queue,
dvb_frontend_should_wakeup(fe) || kthread_should_stop() dvb_frontend_should_wakeup(fe) || kthread_should_stop()
...@@ -550,7 +550,7 @@ restart: ...@@ -550,7 +550,7 @@ restart:
if (try_to_freeze()) if (try_to_freeze())
goto restart; goto restart;
if (down_interruptible(&fepriv->sem)) if (anon_down_interruptible(&fepriv->sem))
break; break;
if (fepriv->reinitialise) { if (fepriv->reinitialise) {
...@@ -678,7 +678,7 @@ static void dvb_frontend_stop(struct dvb_frontend *fe) ...@@ -678,7 +678,7 @@ static void dvb_frontend_stop(struct dvb_frontend *fe)
kthread_stop(fepriv->thread); kthread_stop(fepriv->thread);
semaphore_init(&fepriv->sem); anon_semaphore_init(&fepriv->sem);
fepriv->state = FESTATE_IDLE; fepriv->state = FESTATE_IDLE;
/* paranoia check in case a signal arrived */ /* paranoia check in case a signal arrived */
...@@ -747,7 +747,7 @@ static int dvb_frontend_start(struct dvb_frontend *fe) ...@@ -747,7 +747,7 @@ static int dvb_frontend_start(struct dvb_frontend *fe)
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
if (down_interruptible (&fepriv->sem)) if (anon_down_interruptible (&fepriv->sem))
return -EINTR; return -EINTR;
fepriv->state = FESTATE_IDLE; fepriv->state = FESTATE_IDLE;
...@@ -760,7 +760,7 @@ static int dvb_frontend_start(struct dvb_frontend *fe) ...@@ -760,7 +760,7 @@ static int dvb_frontend_start(struct dvb_frontend *fe)
if (IS_ERR(fe_thread)) { if (IS_ERR(fe_thread)) {
ret = PTR_ERR(fe_thread); ret = PTR_ERR(fe_thread);
printk("dvb_frontend_start: failed to start kthread (%d)\n", ret); printk("dvb_frontend_start: failed to start kthread (%d)\n", ret);
up(&fepriv->sem); anon_up(&fepriv->sem);
return ret; return ret;
} }
fepriv->thread = fe_thread; fepriv->thread = fe_thread;
...@@ -1372,7 +1372,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, ...@@ -1372,7 +1372,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
cmd == FE_DISEQC_RECV_SLAVE_REPLY)) cmd == FE_DISEQC_RECV_SLAVE_REPLY))
return -EPERM; return -EPERM;
if (down_interruptible (&fepriv->sem)) if (anon_down_interruptible (&fepriv->sem))
return -ERESTARTSYS; return -ERESTARTSYS;
if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY))
...@@ -1382,7 +1382,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, ...@@ -1382,7 +1382,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
err = dvb_frontend_ioctl_legacy(inode, file, cmd, parg); err = dvb_frontend_ioctl_legacy(inode, file, cmd, parg);
} }
up(&fepriv->sem); anon_up(&fepriv->sem);
return err; return err;
} }
...@@ -1909,7 +1909,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb, ...@@ -1909,7 +1909,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
} }
fepriv = fe->frontend_priv; fepriv = fe->frontend_priv;
semaphore_init(&fepriv->sem); anon_semaphore_init(&fepriv->sem);
init_waitqueue_head (&fepriv->wait_queue); init_waitqueue_head (&fepriv->wait_queue);
init_waitqueue_head (&fepriv->events.wait_queue); init_waitqueue_head (&fepriv->events.wait_queue);
mutex_init(&fepriv->events.mtx); mutex_init(&fepriv->events.mtx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment