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

staging: comedi: quatech_daqp_cs: simplify IRQ_NONE checks in daqp_interrupt()

Remove all the pr_warn() noise in the sanity checks that make sure
the interrupt is for this device.

Simplify the sanity checks into one if() condition.
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 b8319710
...@@ -238,37 +238,13 @@ static int daqp_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -238,37 +238,13 @@ static int daqp_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
static enum irqreturn daqp_interrupt(int irq, void *dev_id) static enum irqreturn daqp_interrupt(int irq, void *dev_id)
{ {
struct local_info_t *local = dev_id; struct local_info_t *local = dev_id;
struct comedi_device *dev; struct comedi_device *dev = local ? local->dev : NULL;
struct comedi_subdevice *s; struct comedi_subdevice *s = local ? local->s : NULL;
int loop_limit = 10000; int loop_limit = 10000;
int status; int status;
if (local == NULL) { if (!dev || !dev->attached || !s || s->private != local)
pr_warn("irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
dev = local->dev;
if (dev == NULL) {
pr_warn("NULL comedi_device.\n");
return IRQ_NONE;
}
if (!dev->attached) {
pr_warn("struct comedi_device not yet attached.\n");
return IRQ_NONE; return IRQ_NONE;
}
s = local->s;
if (s == NULL) {
pr_warn("NULL comedi_subdevice.\n");
return IRQ_NONE;
}
if (s->private != local) {
pr_warn("invalid comedi_subdevice.\n");
return IRQ_NONE;
}
switch (local->interrupt_mode) { switch (local->interrupt_mode) {
......
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