struct jr3_pci_dev_private {
struct jr3_t __iomem *iobase;
- int n_channels;
struct timer_list timer;
};
static int jr3_pci_open(struct comedi_device *dev)
{
- struct jr3_pci_dev_private *devpriv = dev->private;
struct jr3_pci_subdev_private *spriv;
struct comedi_subdevice *s;
int i;
dev_dbg(dev->class_dev, "jr3_pci_open\n");
- for (i = 0; i < devpriv->n_channels; i++) {
+ for (i = 0; i < dev->n_subdevices; i++) {
s = &dev->subdevices[i];
spriv = s->private;
if (spriv)
const u8 *data, size_t size,
unsigned long context)
{
- struct jr3_pci_dev_private *devpriv = dev->private;
int subdev;
int ret;
return ret;
/* write firmware to each subdevice */
- for (subdev = 0; subdev < devpriv->n_channels; subdev++)
+ for (subdev = 0; subdev < dev->n_subdevices; subdev++)
jr3_write_firmware(dev, subdev, data, size);
return 0;
now = jiffies;
/* Poll all channels that are ready to be polled */
- for (i = 0; i < devpriv->n_channels; i++) {
+ for (i = 0; i < dev->n_subdevices; i++) {
s = &dev->subdevices[i];
spriv = s->private;
if (!devpriv->iobase)
return -ENOMEM;
- devpriv->n_channels = board->n_subdevs;
- ret = comedi_alloc_subdevices(dev, devpriv->n_channels);
+ ret = comedi_alloc_subdevices(dev, board->n_subdevs);
if (ret)
return ret;
dev->open = jr3_pci_open;
- for (i = 0; i < devpriv->n_channels; i++) {
+ for (i = 0; i < dev->n_subdevices; i++) {
s = &dev->subdevices[i];
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND;
}
/* Start card timer */
- for (i = 0; i < devpriv->n_channels; i++) {
+ for (i = 0; i < dev->n_subdevices; i++) {
s = &dev->subdevices[i];
spriv = s->private;