diff options
| author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-03-07 13:40:59 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-17 12:38:53 -0700 |
| commit | a448376e4dbcf3129fb0ec3cc0346660f67a7309 (patch) | |
| tree | ec46ad3107254d28027ddab1b5f43878336e4ee4 | |
| parent | 3c77274cbd933f980dd6eae9f535684a0fd51b28 (diff) | |
staging: comedi: jr3_pci: tidy up jr3_pci_poll_dev()
For aesthetics, rename the subdevice private data pointer from 'subdevpriv'
to 'spriv' and add a local variable for the comedi_subdevice pointer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/comedi/drivers/jr3_pci.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index 455301651a2c..b04cf39162fb 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -588,9 +588,11 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice *s) static void jr3_pci_poll_dev(unsigned long data) { - unsigned long flags; struct comedi_device *dev = (struct comedi_device *)data; struct jr3_pci_dev_private *devpriv = dev->private; + struct jr3_pci_subdev_private *spriv; + struct comedi_subdevice *s; + unsigned long flags; unsigned long now; int delay; int i; @@ -598,18 +600,22 @@ static void jr3_pci_poll_dev(unsigned long data) spin_lock_irqsave(&dev->spinlock, flags); delay = 1000; now = jiffies; - /* Poll all channels that are ready to be polled */ + + /* Poll all channels that are ready to be polled */ for (i = 0; i < devpriv->n_channels; i++) { - struct jr3_pci_subdev_private *subdevpriv = - dev->subdevices[i].private; - if (now > subdevpriv->next_time_min) { + s = &dev->subdevices[i]; + spriv = s->private; + + if (now > spriv->next_time_min) { struct poll_delay_t sub_delay; - sub_delay = jr3_pci_poll_subdevice(&dev->subdevices[i]); - subdevpriv->next_time_min = - jiffies + msecs_to_jiffies(sub_delay.min); - subdevpriv->next_time_max = - jiffies + msecs_to_jiffies(sub_delay.max); + sub_delay = jr3_pci_poll_subdevice(s); + + spriv->next_time_min = jiffies + + msecs_to_jiffies(sub_delay.min); + spriv->next_time_max = jiffies + + msecs_to_jiffies(sub_delay.max); + if (sub_delay.max && sub_delay.max < delay) /* * Wake up as late as possible -> |
