Commit 96764373 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: adl_pci9111: remove pci9111_is_fifo_* macros

These macros rely on a local variable having a specific name.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0f0bde92
...@@ -161,17 +161,6 @@ a multiple of chanlist_len*convert_arg. ...@@ -161,17 +161,6 @@ a multiple of chanlist_len*convert_arg.
dev->iobase + PCI9111_REGISTER_INTERRUPT_CONTROL); \ dev->iobase + PCI9111_REGISTER_INTERRUPT_CONTROL); \
} while (0) } while (0)
#define pci9111_is_fifo_full() \
((inb(dev->iobase + PCI9111_RANGE_STATUS_REG)& \
PCI9111_FIFO_FULL_MASK) == 0)
#define pci9111_is_fifo_half_full() \
((inb(dev->iobase + PCI9111_RANGE_STATUS_REG)& \
PCI9111_FIFO_HALF_FULL_MASK) == 0)
#define pci9111_is_fifo_empty() \
((inb(dev->iobase + PCI9111_RANGE_STATUS_REG)& \
PCI9111_FIFO_EMPTY_MASK) == 0)
static const struct comedi_lrange pci9111_hr_ai_range = { static const struct comedi_lrange pci9111_hr_ai_range = {
5, 5,
...@@ -698,6 +687,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) ...@@ -698,6 +687,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
struct pci9111_private_data *dev_private = dev->private; struct pci9111_private_data *dev_private = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
struct comedi_async *async; struct comedi_async *async;
unsigned int status;
unsigned long irq_flags; unsigned long irq_flags;
unsigned char intcsr; unsigned char intcsr;
...@@ -729,7 +719,10 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) ...@@ -729,7 +719,10 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
(PLX9050_LINTI1_ENABLE | PLX9050_LINTI1_STATUS)) { (PLX9050_LINTI1_ENABLE | PLX9050_LINTI1_STATUS)) {
/* Interrupt comes from fifo_half-full signal */ /* Interrupt comes from fifo_half-full signal */
if (pci9111_is_fifo_full()) { status = inb(dev->iobase + PCI9111_RANGE_STATUS_REG);
/* '0' means FIFO is full, data may have been lost */
if (!(status & PCI9111_FIFO_FULL_MASK)) {
spin_unlock_irqrestore(&dev->spinlock, irq_flags); spin_unlock_irqrestore(&dev->spinlock, irq_flags);
comedi_error(dev, PCI9111_DRIVER_NAME " fifo overflow"); comedi_error(dev, PCI9111_DRIVER_NAME " fifo overflow");
pci9111_interrupt_clear(); pci9111_interrupt_clear();
...@@ -740,7 +733,8 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) ...@@ -740,7 +733,8 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
if (pci9111_is_fifo_half_full()) { /* '0' means FIFO is half-full */
if (!(status & PCI9111_FIFO_HALF_FULL_MASK)) {
unsigned int num_samples; unsigned int num_samples;
unsigned int bytes_written = 0; unsigned int bytes_written = 0;
...@@ -844,14 +838,14 @@ static int pci9111_ai_insn_read(struct comedi_device *dev, ...@@ -844,14 +838,14 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
unsigned int maxdata = s->maxdata; unsigned int maxdata = s->maxdata;
unsigned int invert = (maxdata + 1) >> 1; unsigned int invert = (maxdata + 1) >> 1;
unsigned int shift = (maxdata == 0xffff) ? 0 : 4; unsigned int shift = (maxdata == 0xffff) ? 0 : 4;
unsigned int current_range; unsigned int status;
int timeout; int timeout;
int i; int i;
outb(chan, dev->iobase + PCI9111_AI_CHANNEL_REG); outb(chan, dev->iobase + PCI9111_AI_CHANNEL_REG);
current_range = inb(dev->iobase + PCI9111_RANGE_STATUS_REG); status = inb(dev->iobase + PCI9111_RANGE_STATUS_REG);
if ((current_range & PCI9111_RANGE_MASK) != range) { if ((status & PCI9111_RANGE_MASK) != range) {
outb(range & PCI9111_RANGE_MASK, outb(range & PCI9111_RANGE_MASK,
dev->iobase + PCI9111_AI_RANGE_REG); dev->iobase + PCI9111_AI_RANGE_REG);
} }
...@@ -864,7 +858,9 @@ static int pci9111_ai_insn_read(struct comedi_device *dev, ...@@ -864,7 +858,9 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
timeout = PCI9111_AI_INSTANT_READ_TIMEOUT; timeout = PCI9111_AI_INSTANT_READ_TIMEOUT;
while (timeout--) { while (timeout--) {
if (!pci9111_is_fifo_empty()) status = inb(dev->iobase + PCI9111_RANGE_STATUS_REG);
/* '1' means FIFO is not empty */
if (status & PCI9111_FIFO_EMPTY_MASK)
goto conversion_done; goto conversion_done;
} }
......
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