diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-05-27 17:31:06 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-28 21:28:55 (GMT) |
commit | 35a51030995157dc03142ae6f9e17741b0224beb (patch) | |
tree | cae7aa3303f13f9918d620ec4d5812c307fed53a /drivers/staging/comedi | |
parent | 3ba01fe6188196be85d0a384395c7b5a0f4b8546 (diff) | |
download | linux-35a51030995157dc03142ae6f9e17741b0224beb.tar.xz |
staging: comedi: amplc_pci224: use cfc_bytes_per_scan()
The cmd->chanlist_len will always be >= 1 in this function. Remove the
unnecessary checks.
Use the comedi_fc helper function to get the 'bytes_per_scan'.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-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/amplc_pci224.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c index 44904fd..339c47c 100644 --- a/drivers/staging/comedi/drivers/amplc_pci224.c +++ b/drivers/staging/comedi/drivers/amplc_pci224.c @@ -545,18 +545,12 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, { struct pci224_private *devpriv = dev->private; struct comedi_cmd *cmd = &s->async->cmd; + unsigned int bytes_per_scan = cfc_bytes_per_scan(s); unsigned int num_scans; unsigned int room; unsigned short dacstat; unsigned int i, n; - unsigned int bytes_per_scan; - if (cmd->chanlist_len) { - bytes_per_scan = cmd->chanlist_len * sizeof(short); - } else { - /* Shouldn't get here! */ - bytes_per_scan = sizeof(short); - } /* Determine number of scans available in buffer. */ num_scans = comedi_buf_read_n_available(s) / bytes_per_scan; if (cmd->stop_src == TRIG_COUNT) { @@ -597,8 +591,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, } } /* Determine how many new scans can be put in the FIFO. */ - if (cmd->chanlist_len) - room /= cmd->chanlist_len; + room /= cmd->chanlist_len; /* Determine how many scans to process. */ if (num_scans > room) |