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

staging: comedi: ni_660x: fix memory barrier without comment

Fix the checkpatch.pl issue. Move the memory barrier to a better place.
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 e8f6e2b9
...@@ -613,9 +613,11 @@ static irqreturn_t ni_660x_interrupt(int irq, void *d) ...@@ -613,9 +613,11 @@ static irqreturn_t ni_660x_interrupt(int irq, void *d)
if (!dev->attached) if (!dev->attached)
return IRQ_NONE; return IRQ_NONE;
/* make sure dev->attached is checked before doing anything else */
smp_mb();
/* lock to avoid race with comedi_poll */ /* lock to avoid race with comedi_poll */
spin_lock_irqsave(&devpriv->interrupt_lock, flags); spin_lock_irqsave(&devpriv->interrupt_lock, flags);
smp_mb();
for (i = 0; i < dev->n_subdevices; ++i) { for (i = 0; i < dev->n_subdevices; ++i) {
s = &dev->subdevices[i]; s = &dev->subdevices[i];
if (s->type == COMEDI_SUBD_COUNTER) if (s->type == COMEDI_SUBD_COUNTER)
......
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