diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2017-02-17 14:09:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-06 11:16:58 +0300 |
commit | 67aa069d9354299cfdd45d6a6287f593e7258f33 (patch) | |
tree | 7ffb4403a327835f5efe33394a740cdc5aa129e7 /drivers/staging/comedi | |
parent | 048ad49af32fe910259bc5f1a49f464b63a03029 (diff) | |
download | linux-67aa069d9354299cfdd45d6a6287f593e7258f33.tar.xz |
staging: comedi: jr3_pci: remove unneeded 'spriv' checks
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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/jr3_pci.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index 69ed84a385e3..500ec50d26bf 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -279,9 +279,6 @@ static int jr3_pci_ai_insn_read(struct comedi_device *dev, 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))) { @@ -309,9 +306,8 @@ static int jr3_pci_open(struct comedi_device *dev) 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; } @@ -459,9 +455,6 @@ jr3_pci_poll_subdevice(struct comedi_subdevice *s) int errors; int i; - if (!spriv) - return result; - channel = spriv->channel; errors = get_u16(&channel->errors); |