diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2013-05-13 13:31:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 16:14:48 -0700 |
commit | 89c9df1b7974133c9402c2865da937d81e4b2232 (patch) | |
tree | 6f16389405baba1ac1d28bd1b4fbf7b3627b78c9 | |
parent | e6f1838373f14c7b062c092e42d0ba8dac175472 (diff) |
staging: speakup: soft: remove custom locking macros
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/speakup/speakup_soft.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c index e2f5c81e7548..83e08455cd31 100644 --- a/drivers/staging/speakup/speakup_soft.c +++ b/drivers/staging/speakup/speakup_soft.c @@ -179,23 +179,23 @@ static int softsynth_open(struct inode *inode, struct file *fp) unsigned long flags; /*if ((fp->f_flags & O_ACCMODE) != O_RDONLY) */ /* return -EPERM; */ - spk_lock(flags); + spin_lock_irqsave(&speakup_info.spinlock, flags); if (synth_soft.alive) { - spk_unlock(flags); + spin_unlock_irqrestore(&speakup_info.spinlock, flags); return -EBUSY; } synth_soft.alive = 1; - spk_unlock(flags); + spin_unlock_irqrestore(&speakup_info.spinlock, flags); return 0; } static int softsynth_close(struct inode *inode, struct file *fp) { unsigned long flags; - spk_lock(flags); + spin_lock_irqsave(&speakup_info.spinlock, flags); synth_soft.alive = 0; init_pos = 0; - spk_unlock(flags); + spin_unlock_irqrestore(&speakup_info.spinlock, flags); /* Make sure we let applications go before leaving */ speakup_start_ttys(); return 0; @@ -212,12 +212,12 @@ static ssize_t softsynth_read(struct file *fp, char *buf, size_t count, unsigned long flags; DEFINE_WAIT(wait); - spk_lock(flags); + spin_lock_irqsave(&speakup_info.spinlock, flags); while (1) { prepare_to_wait(&speakup_event, &wait, TASK_INTERRUPTIBLE); if (!synth_buffer_empty() || speakup_info.flushing) break; - spk_unlock(flags); + spin_unlock_irqrestore(&speakup_info.spinlock, flags); if (fp->f_flags & O_NONBLOCK) { finish_wait(&speakup_event, &wait); return -EAGAIN; @@ -227,7 +227,7 @@ static ssize_t softsynth_read(struct file *fp, char *buf, size_t count, return -ERESTARTSYS; } schedule(); - spk_lock(flags); + spin_lock_irqsave(&speakup_info.spinlock, flags); } finish_wait(&speakup_event, &wait); @@ -244,16 +244,16 @@ static ssize_t softsynth_read(struct file *fp, char *buf, size_t count, } else { ch = synth_buffer_getc(); } - spk_unlock(flags); + spin_unlock_irqrestore(&speakup_info.spinlock, flags); if (copy_to_user(cp, &ch, 1)) return -EFAULT; - spk_lock(flags); + spin_lock_irqsave(&speakup_info.spinlock, flags); chars_sent++; cp++; } *pos += chars_sent; empty = synth_buffer_empty(); - spk_unlock(flags); + spin_unlock_irqrestore(&speakup_info.spinlock, flags); if (empty) { speakup_start_ttys(); *pos = 0; @@ -285,10 +285,10 @@ static unsigned int softsynth_poll(struct file *fp, int ret = 0; poll_wait(fp, &speakup_event, wait); - spk_lock(flags); + spin_lock_irqsave(&speakup_info.spinlock, flags); if (!synth_buffer_empty() || speakup_info.flushing) ret = POLLIN | POLLRDNORM; - spk_unlock(flags); + spin_unlock_irqrestore(&speakup_info.spinlock, flags); return ret; } |