From: Alessio Igor Bogani <abogani@texware.it>
To: Greg Kroah-Hartman <gregkh@suse.de>,
Oliver Neukum <oliver@neukum.org>,
Arjan van de Ven <arjan@infradead.org>,
Dominik Brodowski <linux@dominikbrodowski.net>,
Bill Pemberton <wfp5p@virginia.edu>,
Jiri Kosina <jkosina@suse.cz>,
Javier Martinez Canillas <martinez.javier@gmail.com>,
Alexander Kurz <linux@kbdbabel.org>
Cc: linux-kernel@vger.kernel.org, Alessio Igor Bogani <abogani@texware.it>
Subject: [PATCH] Staging: comedi: quatech_daqp_cs.c Replace eos semaphore with a completion.
Date: Tue, 18 May 2010 13:12:32 +0200 [thread overview]
Message-ID: <1274181152-25508-1-git-send-email-abogani@texware.it> (raw)
In-Reply-To: <20100516134540.7dd69473@infradead.org>
Build tested only.
Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
---
drivers/staging/comedi/drivers/quatech_daqp_cs.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 197c302..a91db6c 100644
--- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
+++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
@@ -56,6 +56,8 @@ Devices: [Quatech] DAQP-208 (daqp), DAQP-308
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
+#include <linux/completion.h>
+
/* Maximum number of separate DAQP devices we'll allow */
#define MAX_DEV 4
@@ -67,7 +69,7 @@ struct local_info_t {
enum { semaphore, buffer } interrupt_mode;
- struct semaphore eos;
+ struct completion eos;
struct comedi_device *dev;
struct comedi_subdevice *s;
@@ -238,7 +240,7 @@ static int daqp_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
/* Interrupt handler
*
* Operates in one of two modes. If local->interrupt_mode is
- * 'semaphore', just signal the local->eos semaphore and return
+ * 'semaphore', just signal the local->eos completion and return
* (one-shot mode). Otherwise (continuous mode), read data in from
* the card, transfer it to the buffer provided by the higher-level
* comedi kernel module, and signal various comedi callback routines,
@@ -287,7 +289,7 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
case semaphore:
- up(&local->eos);
+ complete(&local->eos);
break;
case buffer:
@@ -401,8 +403,7 @@ static int daqp_ai_insn_read(struct comedi_device *dev,
return -1;
}
- /* Make sure semaphore is blocked */
- sema_init(&local->eos, 0);
+ init_completion(&local->eos);
local->interrupt_mode = semaphore;
local->dev = dev;
local->s = s;
@@ -413,9 +414,9 @@ static int daqp_ai_insn_read(struct comedi_device *dev,
outb(DAQP_COMMAND_ARM | DAQP_COMMAND_FIFO_DATA,
dev->iobase + DAQP_COMMAND);
- /* Wait for interrupt service routine to unblock semaphore */
+ /* Wait for interrupt service routine to unblock completion */
/* Maybe could use a timeout here, but it's interruptible */
- if (down_interruptible(&local->eos))
+ if (wait_for_completion_interruptible(&local->eos))
return -EINTR;
data[i] = inb(dev->iobase + DAQP_FIFO);
--
1.7.0.4
prev parent reply other threads:[~2010-05-18 11:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-15 21:40 [PATCH] Staging: quatech_usb2: Convert eos semaphore to mutex Alessio Igor Bogani
2010-05-15 21:55 ` Oliver Neukum
2010-05-15 22:08 ` Alessio Igor Bogani
2010-05-16 20:45 ` Arjan van de Ven
2010-05-18 11:12 ` Alessio Igor Bogani [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274181152-25508-1-git-send-email-abogani@texware.it \
--to=abogani@texware.it \
--cc=arjan@infradead.org \
--cc=gregkh@suse.de \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=linux@kbdbabel.org \
--cc=martinez.javier@gmail.com \
--cc=oliver@neukum.org \
--cc=wfp5p@virginia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®