summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
AgeCommit message (Collapse)Author
2014-10-20staging: comedi: (regression) channel list must be set for COMEDI_CMD ioctlIan Abbott
`do_cmd_ioctl()`, the handler for the `COMEDI_CMD` ioctl can incorrectly call the Comedi subdevice's `do_cmd()` handler with a NULL channel list pointer. This is a regression as the `do_cmd()` handler has never been expected to deal with that, leading to a kernel OOPS when it tries to dereference it. A NULL channel list pointer is allowed for the `COMEDI_CMDTEST` ioctl, handled by `do_cmdtest_ioctl()` and the subdevice's `do_cmdtest()` handler, but not for the `COMEDI_CMD` ioctl and its handlers. Both `do_cmd_ioctl()` and `do_cmdtest_ioctl()` call `__comedi_get_user_chanlist()` to copy the channel list from user memory into dynamically allocated kernel memory and check it for consistency. That function currently returns 0 if the `user_chanlist` parameter (pointing to the channel list in user memory) is NULL. That's fine for `do_cmdtest_ioctl()`, but `do_cmd_ioctl()` incorrectly assumes the kernel copy of the channel list has been set-up correctly. Fix it by not allowing the `user_chanlist` parameter to be NULL in `__comedi_get_user_chanlist()`, and only calling it from `do_cmdtest_ioctl()` if the parameter is non-NULL. Thanks to Bernd Porr for reporting the bug via an initial patch sent privately. Fixes: c6cd0eefb27b ("staging: comedi: comedi_fops: introduce __comedi_get_user_chanlist()") Reported-by: Bernd Porr <mail@berndporr.me.uk> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Bernd Porr <mail@berndporr.me.uk> Cc: <stable@vger.kernel.org> # 3.15.y 3.16.y 3.17.y Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: add counter subdeviceLuca Ellero
Add counter support for NI USB-6501. The following functions are introduced: - ni6501_counter_command() - ni6501_cnt_insn_config() - ni6501_cnt_insn_read() - ni6501_cnt_insn_write() Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: rename ni6501_send_command()Luca Ellero
Rename ni6501_send_command to ni6501_port_command Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: remove empty linesLuca Ellero
ni6501_send_command(): remove empty lines in case statements Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: remove useless checkLuca Ellero
Remove useless test in ni6501_send_command. The check is useless since this function is called only in this driver. Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: replace spaces with tabsLuca Ellero
ni6501_auto_attach(): replace spaces with tabs to get proper alignment Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: cleanup response_sizeLuca Ellero
Cleanup response_size in ni6501_send_command (READ_PORT command). No logical/functional change is introduced by this patch. Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: update commentsLuca Ellero
Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: ni_usb6501: add counter commandsLuca Ellero
Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: remove comedi_fc moduleIan Abbott
All the exported functions in the "comedi_fc" module have been migrated to the core "comedi" module and renamed, so it is now just a dummy module. Remove it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: migrate copyrights from "comedi_fc.c"Ian Abbott
The "comedi_fc" module was originally written and copyrighted by Frank Mori Hess, but the functionality has been migrated into the core "comedi" module. Move the copyright notices over to the affected .c files in the core comedi module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: add comedi_read_array_from_buffer()Ian Abbott
The "comedi_fc" module contains a few functions useful to Comedi drivers. Their functionality is being migrated to the core "comedi" module and renamed to start with the prefix `comedi_`. As part of this migration, move `cfc_read_array_from_buffer()` into the core comedi module and rename it to `comedi_read_array_from_buffer()`. Change the external declaration of `cfc_read_array_from_buffer()` into an inline function that calls `comedi_read_array_from_buffer()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()Ian Abbott
Since `cfc_write_array_to_buffer()` is just an inline function that calls `comedi_write_array_to_buffer()`, replace calls to the former to the latter in the "comedi_fc.h" header. This is part of the migration of functionality from the "comedi_fc" module to the core "comedi" module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: add comedi_write_array_to_buffer()Ian Abbott
The "comedi_fc" module contains a few functions useful to Comedi drivers. Their functionality is being migrated to the core "comedi" module and renamed to start with the prefix `comedi_`. As part of this migration, move `cfc_write_array_to_buffer()` into the core comedi module and rename it to `comedi_write_array_to_buffer()`. Change the external declaration of `cfc_write_array_to_buffer()` into an inline function that calls `comedi_write_array_to_buffer()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is constIan Abbott
The `data` pointer of `cfc_write_array_to_buffer()` ought to point to `const` data. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: add comedi_handle_events()Ian Abbott
The "comedi_fc" module contains a few functions useful to Comedi drivers. Their functionality is being migrated to the core "comedi" module and renamed to start with the prefix `comedi_`. As part of this migration, move `cfc_handle_events()` into the core comedi module and rename it to `comedi_handle_events()`. Change the external declaration of `cfc_handle_events()` into an inline function that calls `comedi_handle_events()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: comedi_fc: use comedi_inc_scan_progress()Ian Abbott
Since `cfc_inc_scan_progress()` is just an inline function that calls `comedi_inc_scan_progress()`, replace calls to the former to the latter in the "comedi_fc" module. This is part of the migration of functionality from the "comedi_fc" module to the core "comedi" module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: add comedi_inc_scan_progress()Ian Abbott
The "comedi_fc" module contains a few functions useful to Comedi drivers. Their functionality is being migrated to the core "comedi" module and renamed to start with the prefix `comedi_`. As part of this migration, move `cfc_inc_scan_progress()` into the core comedi module and rename it to `comedi_inc_scan_progress()`. Change the external declaration of `cfc_inc_scan_progress()` into an inline function that calls `comedi_inc_scan_progress()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: comedi_fc: use comedi_bytes_per_scan()Ian Abbott
Since `cfc_bytes_per_scan()` is just an inline function that calls `comedi_bytes_per_scan()`, replace calls to the former to the latter in the "comedi_fc" module. This is part of the migration of functionality from the "comedi_fc" module to the core "comedi" module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: add comedi_bytes_per_scan()Ian Abbott
The "comedi_fc" module contains a few functions useful to Comedi drivers. Their functionality is being migrated to the core "comedi" module and renamed to start with the prefix `comedi_`. As part of this migration, move `cfc_bytes_per_scan()` into the core comedi module and rename it to `comedi_bytes_per_scan()`. Change the external declaration of `cfc_bytes_per_scan()` into an inline function that calls `comedi_bytes_per_scan()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: addi_apci_3120: simplify setting of devpriv->us_UseDmaIan Abbott
`apci3120_auto_attach()` first sets `devpriv->us_UseDma` to 1, then sets it back to 0 if it fails to allocate the DMA buffer. Since `*devpriv` is initially zeroed out by `comedi_alloc_devpriv()`, change it to only set `devpriv->us_UseDma` to 1 if the allocation succeeds. Also, don't bother explicitly initializing `devpriv->b_DmaDoubleBuffer` to 0 as it is already zeroed out. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: addi_apci_3120: use dma_alloc_coherent()Ian Abbott
Use `dma_alloc_coherent()` to allocate the DMA buffers instead of using `__get_free_pages()` to allocate and `virt_to_bus()` to get the hardware address. The coherent buffers are fairly small - at most 4 pages (although there are two of them). Use of `virt_to_bus()` is discouraged. Note: `struct addi_private` is used by some other ADDI-DATA drivers as well, but this is the only one using the affected members. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: addi_apci_3120: don't overallocate DMA bufferIan Abbott
The last parameter of `__get_free_pages()` is log2 (the 'order') of the number of pages to be allocated. This driver seems to think it is the linear number of pages, so `apci3120_auto_attach()` first tries to allocate 16 pages, but only uses 4 of them, setting the buffer size to PAGE_SIZE multiplied by the 'order'. If the allocation fails, it tries progressively smaller orders, down to 0. If the allocation at order 0 succeeds, the buffer size is set to 0, which is likely to cause problems. Set the buffer size to `PAGE_SIZE` shifted left by the allocation order. Since the maximum buffer size previously used was 4, start with an allocation order of 2 instead of 4. Rename the `ui_DmaBufferPages` member of `struct addi_private` to `ui_DmaBufferPageOrder` and rename the `pages` local variable to `order` to make it clearer what it is. Note: `struct addi_private` is used by some other ADDI-DATA drivers as well, but this is the only one using the affected members. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: addi_apci_3120: don't allocate 2nd DMA buffer on failureIan Abbott
`apci3120_auto_attach()` tries to allocate two DMA buffers but may allocate a single buffer or none at all. If it fails to allocate the first buffer, it still tries to allocate the second buffer, even though it won't be used. Change it to not bother trying to allocate the second buffer if the first one fails. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: remove comedi_board()Ian Abbott
All calls to the inline function `comedi_board()` in "comedidev.h" have been removed, so remove the function. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: adl_pci9118: use dma_alloc_coherent()Ian Abbott
Use `dma_alloc_coherent()` to allocate the DMA buffers instead of using `__get_free_pages()` to allocate and `virt_to_bus()` to get the hardware address. The coherent buffers are fairly small - at most 4 pages (although there are two of them). Use of `virt_to_bus()` is discouraged. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: adl_pci9118: don't overallocate DMA bufferIan Abbott
The last parameter of `__get_free_pages()` is log2 (the 'order') of the number of pages to be allocated. This driver seems to think it is the linear number of pages, so `pci9118_alloc_dma()` first tries to allocate 16 pages, but only uses 4 of them, setting the buffer size to PAGE_SIZE multiplied by the 'order'. If the allocation fails, it tries progressively smaller orders, down to 0. If the allocation at order 0 succeeds, the buffer size is set to 0, which is likely to cause problems. Set the buffer size to `PAGE_SIZE` shifted left by the allocation order. Since the maximum buffer size previously used was 4, start with an allocation order of 2 instead of 4. Rename the `pages` member of `struct pci9118_dmabuf` (and the local variable in `pci9118_alloc_dma()`) to `order` to make it clearer what it is. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: comedi: adl_pci9118: don't allocate 2nd DMA buffer on failureIan Abbott
`pci9118_alloc_dma()` tries to allocate two DMA buffers but may allocate a single buffer or none at all. If it fails to allocate the first buffer, it still tries to allocate the second buffer, even though it won't be used. Change it to not bother trying to allocate the second buffer if the first one fails. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: comedi: adl_pci9118: replace comedi_board() callsIan Abbott
The `comedi_board(dev)` inline function calls just return `dev->board_ptr`. Expand the inline function calls. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: comedi: amplc_dio200_common: replace comedi_board() callsIan Abbott
The `comedi_board(dev)` inline function calls just return `dev->board_ptr`. Expand the inline function calls. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: comedi: hwdrv_apci3120: remove void function return statementChase Southwood
Returns at the end of void functions are useless. Remove this one. Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: comedi: hwdrv_apci3120: else is not useful after returnChase Southwood
The statement nested in an else after a return may be brought out one indent level, the else is useless. Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: comedi: hwdrv_apci3120: add a blank line after declarationsChase Southwood
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: comedi: hwdrv_apci3120: clean up commentsChase Southwood
This patch fixes improper comment indentation, removes dead code and obsolete comments, and conforms remaining comments to a consistent kernel commenting style. Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: comedi: usbduxsigma: prevent "empty acquisition" async commandsH Hartley Sweeten
This driver currently allows a cmd->stop_src == TRIG_COUNT with a cmd->stop_arg of 0 for both the analog input and output async commands. The (*do_cmd) for both subdevices sets up and starts the command without handling the "empty acquisition". This results in the interrupt functions trying to transfer 0 data samples. Validate that the cmd->stop_arg is >= 1 in the (*do_cmdtest) to prevent the "empty acquisition". 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>
2014-09-11staging: comedi: usbdux: prevent "empty acquisition" async commandsH Hartley Sweeten
This driver currently allows a cmd->stop_src == TRIG_COUNT with a cmd->stop_arg of 0 for both the analog input and output async commands. The (*do_cmd) for both subdevices sets up and starts the command without handling the "empty acquisition". This results in the interrupt functions trying to transfer 0 data samples. Validate that the cmd->stop_arg is >= 1 in the (*do_cmdtest) to prevent the "empty acquisition". 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>
2014-09-11staging: comedi: s626: fix cmd->stop_arg validation for stop_src == TRIG_COUNTH Hartley Sweeten
The only limit for the stop_arg with a stop_src == TRIG_COUNT is that there is at least 1 scan in order to prevent an empty acquisition. The max test is bogus. Fix the validation. 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>
2014-09-11staging: comedi: s626: 'ai_sample_count' is always 'stop_arg'H Hartley Sweeten
When the cmd->stop_src == TRIG_COUNT, the 'ai_sample_count' is the cmd->stop_arg. For a stop_src == TRIG_NONE the 'ai_sample_count' is currently set to 1 but the driver never actually uses the value. Simplify the 'stop_count' initialization by just setting it to the cmd->stop_arg. 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>
2014-09-11staging: comedi: s626: clarify COMEDI_CB_EOA codeH Hartley Sweeten
The end-of-acquisition only applies when the cmd->stop_src == TRIG_COUNT. Refactor the code in s626_handle_eos_interrupt() that detects the end-of- acquisition to clarify this. 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>
2014-09-11staging: comedi: s626: remove 'ai_continuous' from private dataH Hartley Sweeten
This member of the private data is set based on the cmd->stop_src. Just use the cmd->stop_src directly and remove the member. 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>
2014-09-11staging: comedi: rtd520: prevent "empty acquisition" async commandH Hartley Sweeten
This driver currently allows a cmd->stop_src == TRIG_COUNT with a cmd->stop_arg of 0. The (*do_cmd) then sets up and starts the command without handling the "empty acquisition". This results in the interrupt function trying to transfer 0 data samples. Validate that the cmd->stop_arg is >= 1 in the (*do_cmdtest) to prevent the "empty acquisition". 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>
2014-09-11staging: comedi: pcmuio: return void from pcmuio_start_intr()H Hartley Sweeten
This function always returns '0' so the comedi_event() is never done by the callers. Change the return type to void and remove the comedi_event() dead code. 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>
2014-09-11staging: comedi: pcmuio: 'stop_count' is always 'stop_arg'H Hartley Sweeten
When the cmd->stop_src == TRIG_COUNT, the 'stop_count' is the cmd->stop_arg. For any other stop_src the 'stop_count' is 0, which is also the cmd->stop_arg. Simplify the 'stop_count' initialization. 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>
2014-09-11staging: comedi: pcmuio: remove 'continuous' from private dataH Hartley Sweeten
This member of the private data is set based on the cmd->stop_src. Just use the cmd->stop_src directly and remove the member. 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>
2014-09-11staging: comedi: pcmuio: remove "empty acquisition" async commandH Hartley Sweeten
This driver currently allows a cmd->stop_src == TRIG_COUNT with a cmd->stop_arg of 0. This causes the (*do_cmd) to immediately generate a COMEDI_CB_EOA event without acquiring any data. This "empty acquisition" async command is not really useful. Validate that the cmd->stop_arg is >= 1 in the (*do_cmdtest) and remove the "empty acquisition" code. 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>
2014-09-11staging: comedi: pcmmio: return void from pcmmio_start_intr()H Hartley Sweeten
This function always returns '0' so the comedi_event() is never done by the callers. Change the return type to void and remove the comedi_event() dead code. 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>
2014-09-11staging: comedi: pcmmio: 'stop_count' is always 'stop_arg'H Hartley Sweeten
When the cmd->stop_src == TRIG_COUNT, the 'stop_count' is the cmd->stop_arg. For any other stop_src the 'stop_count' is 0, which is also the cmd->stop_arg. Simplify the 'stop_count' initialization. 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>
2014-09-11staging: comedi: pcmmio: remove "empty acquisition" async commandH Hartley Sweeten
This driver currently allows a cmd->stop_src == TRIG_COUNT with a cmd->stop_arg of 0. This causes the (*do_cmd) to immediately generate a COMEDI_CB_EOA event without acquiring any data. This "empty acquisition" async command is not really useful. Validate that the cmd->stop_arg is >= 1 in the (*do_cmdtest) and remove the "empty acquisition" code. 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>
2014-09-11staging: comedi: pcl711: remove "empty acquisition" async commandH Hartley Sweeten
This driver currently allows a cmd->stop_src == TRIG_COUNT with a cmd->stop_arg of 0. This causes the (*do_cmd) to immediately generate a COMEDI_CB_EOA event without acquiring any data. This "empty acquisition" async command is not really useful. Validate that the cmd->stop_arg is >= 1 in the (*do_cmdtest) and remove the "empty acquisition" code. 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>
2014-09-11staging: comedi: ni_pcidio: prevent "empty acquisition" async commandH Hartley Sweeten
This driver currently allows a cmd->stop_src == TRIG_COUNT with a cmd->stop_arg of 0. The (*do_cmd) then sets up and starts the command without handling the "empty acquisition". This results in the interrupt function trying to transfer 0 data samples. Validate that the cmd->stop_arg is >= 1 in the (*do_cmdtest) to prevent the "empty acquisition". 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>