If `jr3_pci_auto_attach()` returns with no error, we can now be sure
that the COMEDI subdevice private data structures have been allocated.
Remove the tests for a valid pointer to the private data structure in
`jr3_pci_ai_insn_read()`, `jr3_pci_open()`, and
`jr3_pci_poll_subdevice()`, since they will not be called if the pointer
is invalid.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
u16 errors;
int i;
- if (!spriv)
- return -EINVAL;
-
errors = get_u16(&spriv->channel->errors);
if (spriv->state != state_jr3_done ||
(errors & (watch_dog | watch_dog2 | sensor_change))) {
for (i = 0; i < dev->n_subdevices; i++) {
s = &dev->subdevices[i];
spriv = s->private;
- if (spriv)
- dev_dbg(dev->class_dev, "serial: %p %d (%d)\n",
- spriv, spriv->serial_no, s->index);
+ dev_dbg(dev->class_dev, "serial: %p %d (%d)\n",
+ spriv, spriv->serial_no, s->index);
}
return 0;
}
int errors;
int i;
- if (!spriv)
- return result;
-
channel = spriv->channel;
errors = get_u16(&channel->errors);