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

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: 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 3c77274c
...@@ -588,9 +588,11 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice *s) ...@@ -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) static void jr3_pci_poll_dev(unsigned long data)
{ {
unsigned long flags;
struct comedi_device *dev = (struct comedi_device *)data; struct comedi_device *dev = (struct comedi_device *)data;
struct jr3_pci_dev_private *devpriv = dev->private; struct jr3_pci_dev_private *devpriv = dev->private;
struct jr3_pci_subdev_private *spriv;
struct comedi_subdevice *s;
unsigned long flags;
unsigned long now; unsigned long now;
int delay; int delay;
int i; int i;
...@@ -598,18 +600,22 @@ static void jr3_pci_poll_dev(unsigned long data) ...@@ -598,18 +600,22 @@ static void jr3_pci_poll_dev(unsigned long data)
spin_lock_irqsave(&dev->spinlock, flags); spin_lock_irqsave(&dev->spinlock, flags);
delay = 1000; delay = 1000;
now = jiffies; 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++) { for (i = 0; i < devpriv->n_channels; i++) {
struct jr3_pci_subdev_private *subdevpriv = s = &dev->subdevices[i];
dev->subdevices[i].private; spriv = s->private;
if (now > subdevpriv->next_time_min) {
if (now > spriv->next_time_min) {
struct poll_delay_t sub_delay; struct poll_delay_t sub_delay;
sub_delay = jr3_pci_poll_subdevice(&dev->subdevices[i]); sub_delay = jr3_pci_poll_subdevice(s);
subdevpriv->next_time_min =
jiffies + msecs_to_jiffies(sub_delay.min); spriv->next_time_min = jiffies +
subdevpriv->next_time_max = msecs_to_jiffies(sub_delay.min);
jiffies + msecs_to_jiffies(sub_delay.max); spriv->next_time_max = jiffies +
msecs_to_jiffies(sub_delay.max);
if (sub_delay.max && sub_delay.max < delay) if (sub_delay.max && sub_delay.max < delay)
/* /*
* Wake up as late as possible -> * Wake up as late as possible ->
......
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