summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2014-03-17Staging: comedi: propagate timeout errors in s626.cChase Southwood
This patch for s626.c propagates the errors from the newly introduced calls to comedi_timeout() as far as possible. Signed-off-by: Chase Southwood <chase.southwood@yahoo.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17Staging: comedi: convert while loops to timeouts in s626.cChase Southwood
This patch changes a handful of while loops to timeouts to prevent infinite looping on hardware failure. A couple such loops are in a function (s626_debi_transfer()) which is called from critical sections, so comedi_timeout() is unusable for them, and an iterative timeout is used instead. For the while loops in a context where comedi_timeout() is allowed, a new callback function, s626_send_dac_eoc(), has been defined to evaluate the conditions that the while loops are testing. The new callback employs a switch statement based on a simple new enum so that it is usable for all of the different conditions tested in while loops in s626_send_dac(). The proper comedi_timeout() calls are then used. Signed-off-by: Chase Southwood <chase.southwood@yahoo.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: drivers should not clear the async->eventsH Hartley Sweeten
The comedi core resets the async->events in comedi_buf_reset() which is called when the subdevice is restored to an idle state and at the start of an async command. The async->events are also cleared after handling the events in comedi_event(). Drivers should not clear the events manually. 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-03-17staging: comedi: quatech_daqp_cs: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Update the Kconfig so that COMEDI_QUATECH_DAQP_CS selects COMEDI_FC. 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-03-17staging: comedi: ni_pcidio: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function instead of duplicating the code. In the Kconfig, COMEDI_NI_PCIDIO selects COMEDI_FC indirectly by selecting COMEDI_MITE which selects COMEDI_FC. 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-03-17staging: comedi: ni_labpc: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Also, remove the clearing of the events, comedi_event() does that. In the Kconfig, COMEDI_NI_LABPC already selects COMEDI_FC. 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-03-17staging: comedi: dt3000: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Update the Kconfig so that COMEDI_DT3000 selects COMEDI_FC. 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-03-17staging: comedi: ni_660x: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function instead of duplicating the code. In the Kconfig, COMEDI_NI_660X selects COMEDI_FC indirectly by selecting COMEDI_NI_TIOCMD which selects COMEDI_MITE which selects COMEDI_FC. 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-03-17staging: comedi: pcl818: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Update the Kconfig so that COMEDI_PCL818 selects COMEDI_FC. 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-03-17staging: comedi: pcl816: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Update the Kconfig so that COMEDI_PCL816 selects COMEDI_FC. 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-03-17staging: comedi: pcl812: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Update the Kconfig so that COMEDI_PCL812 selects COMEDI_FC. 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-03-17staging: comedi: cb_pcidas: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Also, remove the clearing of the events, comedi_event() does that. In the Kconfig, COMEDI_CB_PCIDAS already selects COMEDI_FC. 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-03-17staging: comedi: amplc_pci224: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). In the Kconfig, COMEDI_AMPLC_PCI224 already selects COMEDI_FC. 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-03-17staging: comedi: ni_mio_common: use cfc_handle_events()H Hartley Sweeten
The ni_event() function in this file is an open coded version of cfc_handle_events() where instead of calling the subdevice (*cancel) function a switch is used to call the function based on the subdevice 'index'. Use the comedi_fc helper function to simplify the code. This also allows removing a couple of the forward declarations. Fix the #ifdef/#endif for the ni_gpct_cancel() foward declaration and around the function. This function is now only referenced by code that is blocked with #ifdef PCIDMA. This source file is included by the ni_atmio, ni_mio_cs, and ni_pcimio drivers. In the Kconfig, the config options for these drivers already select COMEDI_FC. 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-03-17staging: comedi: ni_at_a2150: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Also, remove the clearing of the events, comedi_event() does that. In the Kconfig, COMEDI_NI_AT_A2150 already selects COMEDI_FC. 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-03-17staging: comedi: dt282x: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). This also fixes two bugs. 1) the analog input command is canceled due to a buffer overflow without sending an event (@@ -341,7 +340,7 @@). 2) an analog output error causes the command to cancel but the event is reported to the analog input subdevice (@@ -449,15 +447,13 @@). In the Kconfig, COMEDI_DT282X already selects COMEDI_FC. 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-03-17staging: comedi: das1800: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). In the Kconfig, COMEDI_DAS1800 already selects COMEDI_FC. 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-03-17staging: comedi: das800: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Also, remove the clearing of the event, comedi_event() does that. In the Kconfig, COMEDI_DAS800 already selects COMEDI_FC. 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-03-17staging: comedi: das16m1: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). In the Kconfig, COMEDI_DAS16M1 already selects COMEDI_FC. 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-03-17staging: comedi: adv_pci1710: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Update the Kconfig to select COMEDI_FC when COMEDI_ADL_PCI9111 is enabled. 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-03-17staging: comedi: adl_pci9111: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). In the Kconfig, COMEDI_ADL_PCI9111 already selects COMEDI_FC. 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-03-17staging: comedi: adl_pci9118: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). In the Kconfig, COMEDI_ADL_PCI9118 already selects COMEDI_FC. 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-03-17staging: comedi: mite: use cfc_inc_scan_progress()H Hartley Sweeten
Use the comedi_fc helper function instead of duplicating the 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-03-17staging: comedi: comedi_fc: export increment_scan_progress()H Hartley Sweeten
Rename this function to cfc_inc_scan_progress() and export it for use by the comedi drivers. 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-03-17staging: comedi: comedi_fc: export cfc_bytes_per_scan()H Hartley Sweeten
This helper function is a bit long to be inlined. Move it to the source file and export it. The mite driver is the only external user right now. Update the Kconfig to select COMEDI_FC when COMEDI_MITE is enabled. 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-03-17staging: comedi: comedi_fc: tidy up cfc_bytes_per_scan()H Hartley Sweeten
This function returns the total number of bytes for a full scan of an async command chanlist. The returned value is an unsigned int. Change all the local variables to unsigned int and use a local variable for the s->async->cmd.chanlist_len. 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-03-17staging: comedi: comedi_fc: rename comedi_subdevice variables in headerH Hartley Sweeten
Typically the comedi_subdevice variable is simply named 's'. Rename the variables in comedi_fc.h. 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-03-17staging: comedi: comedi_fc: remove 'extern' from function prototypesH Hartley Sweeten
The 'extern' is not needed in the prototypes for the exported functions in the header. Remove it. 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-03-17staging: comedi: comedi_fc: tidy up multi-line comment in headerH Hartley Sweeten
Tidy up the multi-line comment to follow the CodingStyle. 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-03-17staging: comedi: comedi_fc: remove unnecessary prefix in dev_warn() messageH Hartley Sweeten
The dev_warn() will automatically have the "comedi" prefix. 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-03-17staging: comedi: comedi_fc: rename comedi_subdevice variablesH Hartley Sweeten
Typically the comedi_subdevice variable is simply named 's'. Rename the variables in this file. 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-03-17staging: comedi: comedi_fc: tidy up multi-line commentH Hartley Sweeten
Tidy up the multi-line comment to follow the CodingStyle. 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-03-17staging: comedi: comedi_fc: tidy up module initH Hartley Sweeten
For aesthetics, move the MODULE_* information to the end of the file and move the module_{init,exit}() after the functions. 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-03-17staging: comedi: jr3_pci: remove 'channel_no' from subdevice private dataH Hartley Sweeten
This member of the subdevice private data is just the subdevice 'index'. Use that instead and remove the member. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: rename struct poll_delay_tH Hartley Sweeten
Rename this private struct so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: rename struct transform_tH Hartley Sweeten
Rename this private struct so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: remove 'n_channels' from private dataH Hartley Sweeten
This member of the private data is actually the number of subdevices. We can get that information directly from the comedi_device. Do that instead and remove the unnecessary member from the private data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: introduce boardinfo for the supported boardsH Hartley Sweeten
Create an enum for the boards supported by this driver and pass that enum in the pci_driver id_table as the driver_data. Introduce a boardinfo struct to hold the board specific data for the boards supported by this driver. Use the boardinfo when attaching to the driver instead of using the pcidev->device and the switch. Since the PCI device ids are now only used in the id_table, remove the defines and open code the device ids. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: tidy up jr3_pci_ai_insn_read()H Hartley Sweeten
Refactor this function to make it clearer. The channel does not need to be validated. The comedi core does that for us. Exit early if the subdevice private data is invalid. Exit early if the subdevice 'state' is not done or there is an error. Factor out the code that actually reads the channel data to reduce the indent level. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: tidy up jr3_pci_open()H Hartley Sweeten
For aesthetics, rename the subdevice private data pointer from 'p' to 'spriv' and add a local variable for the comedi_subdevice pointer. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: tidy up jr3_download_firmware()H Hartley Sweeten
This callback function for comedi_load_firmware() first validates that the firmware data is the correct format then it writes the data to each subdevice. Split the two operations out as separate functions to clarify the code. Tidy up the new functions. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: tidy up jr3_pci_poll_subdevice()H Hartley Sweeten
Refactor the function to reduce the indent level. For aesthetics, rename the subdevice private data pointer from 'p' to 'spriv'. Rename the lacal variable used for the channel->full_scale to 'fs' to reduce the line lengths. Remove the setting of range[8]. The min,max values are the same as the ones used when the subdevice private data was allocated and initialized. Remove the poll_delay_min_max() that are the same as the default. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: tidy up jr3_pci_poll_dev()H Hartley Sweeten
For aesthetics, rename the subdevice private data pointer from 'subdevpriv' to 'spriv' and add a local variable for the comedi_subdevice pointer. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: rename some local vars in the (*attach)H Hartley Sweeten
For aesthetics, rename the subdevice private data pointer from 'p' to 'spriv' and the variable used to check the errno from 'result' to 'ret'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: factor subdevice private data init out of (*attach)H Hartley Sweeten
Factor the code that allocates and initializes the subdevice private data out of the (*attach) to reduce the indent level and make the code easier to follow. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: use comedi_alloc_spriv()H Hartley Sweeten
Use the helper function to allocate the subdevice private data. This sets the s->private variable for us and allows the comedi core to automatically kfree() the memory during the (*detach). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: jr3_pci: tidy up subdevice initH Hartley Sweeten
For aesthetics, use a pointer to the comedi_subdevice instead of accessing the dev->subdevices array directly. Move the local variable for the subdevice private data so that this function does not declare the variable twice. Change the kzalloc for the subdevice private data to remove the sizeof(struct foo). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: comedi_fops: introduce __comedi_get_user_chanlist()H Hartley Sweeten
The COMEDI_CMD and COMEDI_CMDTEST ioctl functions both copy the chanlist passed by the user from __user memory space to kernel memory space. They then do some sanity checking of the chanlist with comedi_check_chanlist() before the subdevice (*do_cmdtest) and (*do_cmd) operations are called. Introduce a helper function to handle the memdup_user() and the sanity checking. Also, remove the unnecessary dev_dbg() when the memdup_user() or comedi_check_chanlist() fail. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: comedi_fops: introduce __comedi_get_user_cmd()H Hartley Sweeten
The COMEDI_CMD and COMEDI_CMDTEST ioctl functions both copy the comedi_cmd passed by the user from __user memory space to kernel memory space. They then do some basic sanity checking of the cmd before the subdevice (*do_cmdtest) and (*do_cmd) operations are called. Introduce a helper function to handle the copy_from_user() and do the basic sanity checking. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17Staging: bcm: fixed parentheses and quoted string across lines coding style ↵Joshua Baldock
in CmHost.c This is a patch to the CmHost.c file that fixes up parentheses and quoted string across lines warnings found by checkpatch.pl tool. Signed-off-by: Joshua Baldock <joshua.baldock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>