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

staging: comedi: pcmmio: cleanup indent levels in interrupt_pcmmio()

Remove the extra indent levels in this function that resulted from
code removed in previous patches.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0cc9a4e4
...@@ -359,11 +359,9 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) ...@@ -359,11 +359,9 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct pcmmio_private *devpriv = dev->private; struct pcmmio_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
unsigned triggered = 0;
int got1 = 0; int got1 = 0;
unsigned long flags; unsigned long flags;
unsigned triggered = 0;
/* it is an interrupt for ASIC #asic */
unsigned char int_pend; unsigned char int_pend;
spin_lock_irqsave(&devpriv->pagelock, flags); spin_lock_irqsave(&devpriv->pagelock, flags);
...@@ -373,27 +371,19 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) ...@@ -373,27 +371,19 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
if (int_pend) { if (int_pend) {
int port; int port;
for (port = 0; port < INTR_PORTS_PER_ASIC; for (port = 0; port < INTR_PORTS_PER_ASIC; ++port) {
++port) {
if (int_pend & (0x1 << port)) { if (int_pend & (0x1 << port)) {
unsigned char unsigned char io_lines_with_edges = 0;
io_lines_with_edges = 0;
switch_page(dev, PCMMIO_PAGE_INT_ID); switch_page(dev, PCMMIO_PAGE_INT_ID);
io_lines_with_edges = io_lines_with_edges = inb(dev->iobase +
inb(dev->iobase +
PCMMIO_PAGE_REG(port)); PCMMIO_PAGE_REG(port));
/* clear pending interrupt */
if (io_lines_with_edges) if (io_lines_with_edges)
/*
* clear pending
* interrupt
*/
outb(0, dev->iobase + outb(0, dev->iobase +
PCMMIO_PAGE_REG(port)); PCMMIO_PAGE_REG(port));
triggered |= triggered |= io_lines_with_edges << port * 8;
io_lines_with_edges <<
port * 8;
} }
} }
...@@ -403,54 +393,34 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) ...@@ -403,54 +393,34 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
spin_unlock_irqrestore(&devpriv->pagelock, flags); spin_unlock_irqrestore(&devpriv->pagelock, flags);
if (triggered) { if (triggered) {
/* /* TODO here: dispatch io lines to subdevs with commands */
* TODO here: dispatch io lines to subdevs
* with commands..
*/
unsigned long flags; unsigned long flags;
unsigned oldevents; unsigned oldevents;
spin_lock_irqsave(&devpriv->spinlock, spin_lock_irqsave(&devpriv->spinlock, flags);
flags);
oldevents = s->async->events; oldevents = s->async->events;
if (devpriv->active) { if (devpriv->active) {
unsigned mytrig = unsigned mytrig = ((triggered >> 0) & ((1 << 24) - 1)) << 0;
((triggered >> 0) if (mytrig & devpriv->enabled_mask) {
& unsigned int val = 0;
((0x1 << 24) - unsigned int n, ch, len;
1)) << 0;
if (mytrig & len = s->async->cmd.chanlist_len;
devpriv->enabled_mask) { for (n = 0; n < len; n++) {
unsigned int val
= 0;
unsigned int n,
ch, len;
len =
s->
async->cmd.chanlist_len;
for (n = 0;
n < len;
n++) {
ch = CR_CHAN(s->async->cmd.chanlist[n]); ch = CR_CHAN(s->async->cmd.chanlist[n]);
if (mytrig & (1U << ch)) if (mytrig & (1U << ch))
val |= (1U << n); val |= (1U << n);
} }
/* Write the scan to the buffer. */ /* Write the scan to the buffer. */
if (comedi_buf_put(s->async, val) if (comedi_buf_put(s->async, val) &&
&& comedi_buf_put (s->async, val >> 16)) {
comedi_buf_put
(s->async,
val >> 16)) {
s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS); s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS);
} else { } else {
/* Overflow! Stop acquisition!! */ /* Overflow! Stop acquisition!! */
/* TODO: STOP_ACQUISITION_CALL_HERE!! */ /* TODO: STOP_ACQUISITION_CALL_HERE!! */
pcmmio_stop_intr pcmmio_stop_intr(dev, s);
(dev,
s);
} }
/* Check for end of acquisition. */ /* Check for end of acquisition. */
...@@ -461,25 +431,19 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) ...@@ -461,25 +431,19 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
if (devpriv->stop_count == 0) { if (devpriv->stop_count == 0) {
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
/* TODO: STOP_ACQUISITION_CALL_HERE!! */ /* TODO: STOP_ACQUISITION_CALL_HERE!! */
pcmmio_stop_intr pcmmio_stop_intr(dev, s);
(dev,
s);
} }
} }
} }
} }
} }
spin_unlock_irqrestore spin_unlock_irqrestore(&devpriv->spinlock, flags);
(&devpriv->spinlock, flags);
if (oldevents != if (oldevents != s->async->events)
s->async->events) {
comedi_event(dev, s); comedi_event(dev, s);
} }
}
if (!got1) if (!got1)
return IRQ_NONE; /* interrupt from other source */ return IRQ_NONE; /* interrupt from other source */
return IRQ_HANDLED; return IRQ_HANDLED;
......
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