summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
Commit message (Collapse)AuthorAgeFilesLines
* staging: Remove unnecessary OOM messagesJoe Perches2013-02-1110-88/+27
| | | | | | | | | | | | | | | | | alloc failures already get standardized OOM messages and a dump_stack. For the affected mallocs around these OOM messages: Converted kzallocs with multiplies to kcalloc. Converted kmallocs with multiplies to kmalloc_array. Converted a kmalloc/strlen/strncpy to kstrdup. Moved a spin_lock below a removed OOM message and removed a now unnecessary spin_unlock. Neatened alignment and whitespace. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: correct error message in comedi_alloc_subdevice_minor()Ian Abbott2013-02-071-1/+1
| | | | | | | | | | | `comedi_alloc_subdevice_minors()` currently prints a message about running out of minor numbers board device files if it runs out of minor device numbers. Change it to complain about running out of minor device numbers for subdevice files as these are in a different range, not shared with those for board device files. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: don't return minor from comedi_alloc_subdevice_minor()Ian Abbott2013-02-071-1/+1
| | | | | | | | | | | `comedi_alloc_subdevice_minor()` currently returns the allocated minor device number on success. This is not really of any interest to the caller (in fact the return value is not even checked), so just return 0 on success. If the caller really needs to know the allocated minor device number it can look in `s->minor`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: ni_daq_dio24: add back missing 'if (ret)'H Hartley Sweeten2013-02-071-0/+1
| | | | | | | | | | | | | | | The 'if (ret)' after calling comedi_pcmcia_enable() was accidentally removed in: Commit: 573a964882065f9b2cb71db8a225ba067b4b5b7a staging: comedi: ni_daq_dio24: use comedi_pcmcia_{enable,disable} Put if back so that dio24_auto_attach() can finish attaching to the board after enabling the pcmcia device. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: quatech_daqp_cs: fix build errorH Hartley Sweeten2013-02-061-1/+1
| | | | | | | | | | | | | | | | | | The kbuild test robot reported a build error in this driver caused by: commit: a3ac95195b020a0a8fa2a9b0649145324ba64c83 staging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check() This commit changed the comedi_pcmcia_enable() function so that it now takes two arguments. The new argument is an optional (*conf_check) function that is passed to pcmcia_loop_config(). This driver uses the default (*conf_check) in comedi_pcmcia.c so just pass a NULL as the second arg. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: ni_mio_cs: use pcmcia_request_irq()H Hartley Sweeten2013-02-051-10/+3
| | | | | | | | | | Use pcmcia_request_irq() instead of request_irq() to request the shared irq for the PCMCIA device. This allows the PCMCIA core to clean up the registration in pcmcia_disable_device(). 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>
* staging: comedi: ni_mio_cs: use comedi_pcmcia_{enable, disable}H Hartley Sweeten2013-02-051-12/+4
| | | | | | | | | | | | Use the comedi_pcmcia_{enable,disable} helpers to enable/disable the PCMCIA device. This driver uses a local (*conf_check) to check the pcmcia_device configuration. 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>
* staging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check()H Hartley Sweeten2013-02-057-8/+14
| | | | | | | | | | Allow comedi pcmcia drivers to use a custom conf_check() when calling comedi_pcmcia_enable() to enable the pcmcia device. If a conf_check() is not passed the internal comedi_pcmcia_conf_check() will be used. 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>
* staging: comedi: ni_labpc_cs: use comedi_pcmcia_{enable,disable}H Hartley Sweeten2013-02-051-22/+5
| | | | | | | | | | | | Use the comedi_pcmcia_{enable,disable} helpers to enable/disable the PCMCIA device. This driver is not an audio device, remove CONF_AUTO_AUDIO from the link->config_flags. 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>
* staging: comedi: ni_daq_dio24: use comedi_pcmcia_{enable,disable}H Hartley Sweeten2013-02-051-22/+3
| | | | | | | | | | | | Use the comedi_pcmcia_{enable,disable} helpers to enable/disable the PCMCIA device. This driver does not use interrupts and is not an audio device, remove CONF_ENABLE_IRQ and CONF_AUTO_AUDIO from the link->config_flags. 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>
* staging: comedi: vmk80xx: rename vmk80xx_attach_common()H Hartley Sweeten2013-02-051-2/+2
| | | | | | | | | | | | | In comedi drivers typically *_attach_common() is used as the 'common' part of the comedi_driver attach code for drivers that support various bus types (ISA, PCI, etc.). This driver is specific to a USB device. To avoid confusion when grepping, rename this function to something more appropriate. 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>
* staging: comedi: vmk80xx: remove the 'Changelog' commentsH Hartley Sweeten2013-02-051-13/+0
| | | | | | | | git history provides a better Changelog for 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>
* staging: comedi: vmk80xx: cleanup the comedi_lrange tablesH Hartley Sweeten2013-02-051-6/+5
| | | | | | | | | | | | The vmk8055_range table is a duplicate of the comedi core provided range_unipolar5 table. Use that instead. For aesthetic reasons, clean up the formating of the vmk8061_range table. 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>
* staging: comedi: vmk80xx: remove CONFIG_COMEDI_DEBUG codeH Hartley Sweeten2013-02-051-38/+8
| | | | | | | | | | If CONFIG_COMEDI_DEBUG is defined a macro is enabled to output some printk(KERN_REBUG ...) messages. These are just added noise. Remove it. 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>
* staging: comedi: vmk80xx: remove unused #defineH Hartley Sweeten2013-02-051-2/+0
| | | | | | | | This define is no longer used by the driver. Remove it. 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>
* staging: comedi: vmk80xx: remove digital input (*insn_read)H Hartley Sweeten2013-02-051-47/+0
| | | | | | | | | The comedi core can use the (*insn_bits) function to emulate the (*insn_read) function. Remove the unnecessary (*insn_read) function. 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>
* staging: comedi: vmk80xx: remove digital output (*insn_write)H Hartley Sweeten2013-02-051-50/+0
| | | | | | | | | | The comedi core can use the (*insn_bits) function to emulate the (*insn_write) function. Remove the unnecessary (*insn_read) function. 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>
* staging: comedi: vmk80xx: remove digital output (*insn_read)H Hartley Sweeten2013-02-051-37/+0
| | | | | | | | | | | | | | | | The comedi core can use the (*insn_bits) function to emulate the (*insn_read) function. The digital output (*insn_bits) function properly handles the VMK8061_MODEL to read the digital output states before returning. Remove the unnecessary (*insn_read) function. It's also not necessary to set the SDF_READABLE flag so remove the entire conditional in the attach. 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>
* staging: comedi: vmk80xx: cleanup pwm subdevice initH Hartley Sweeten2013-02-051-18/+18
| | | | | | | | | | | | | | | | | | Change the 'pwm_bits' in the boardinfo to 'pwm_maxdata' so that the calculation of s->maxdata can be removed. Also, change the type to match the comedi_subdevice type. For aesthetic reasons, rename the 'pwm_chans' boardinfo and change its type also. Remove the '0' values in the boardinfo. Rename the (*insn_read) and (*insn_write) functions for the pwm subdevice to make grepping easier. For aesthetic reasons, add some whitespace to the subdevice init. 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>
* staging: comedi: vmk80xx: cleanup counter subdevice initH Hartley Sweeten2013-02-051-20/+23
| | | | | | | | | | | | | | | | | | | Change the 'cnt_bits' in the boardinfo to 'cnt_maxdata' so that the calculation of s->maxdata can be removed. Also, change the type to match the comedi_subdevice type. Add a comment about the '0' value for DEVICE_VMK8061. The s->maxdata should always be set for the subdevice. Move it out of the conditional. Rename the (*insn_read), (*insn_config_, and (*insn_write) functions for the counter subdevice to make grepping easier. For aesthetic reasons, add some whitespace to the subdevice init. 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>
* staging: comedi: vmk80xx: cleanup digital input subdevice initH Hartley Sweeten2013-02-051-17/+21
| | | | | | | | | | | | | | | | Remove the SDF_GROUND flag from s->subdev_flags. This flag only has meaning for analog subdevices. Add the missing s->range_table for the subdevice. Rename the (*insn_write), (*insn_bits), and (*insn_read) functions for the digital input subdevice to make grepping easier. For aesthetic reasons, add some whitespace to the subdevice init. 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>
* staging: comedi: vmk80xx: cleanup digital input subdevice initH Hartley Sweeten2013-02-051-15/+18
| | | | | | | | | | | | | | | | | | | | Change the type for the digital input 'di_chans' boardinfo to match the comedi_subdevice type it is set to. For aesthetic reasons, rename the variable also. Remove the SDF_GROUND flag from s->subdev_flags. This flag only has meaning for analog subdevices. Add the missing s->range_table for the subdevice. Rename the (*insn_read) and (*insn_bits) functions for the digital input subdevice to make grepping easier. For aesthetic reasons, add some whitespace to the subdevice init. 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>
* staging: comedi: vmk80xx: cleanup analog output subdevice initH Hartley Sweeten2013-02-051-17/+19
| | | | | | | | | | | | | | | Change the type for the analog output 'ao_chans' boardinfo to match the comedi_subdevice type it is set to. For aesthetic reasons, rename the variable also. Rename the (*insn_write) and (*insn_read) functions for the analog output subdevice to make grepping easier. For aesthetic reasons, add some whitespace to the subdevice init. 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>
* staging: comedi: vmk80xx: cleanup analog input subdevice initH Hartley Sweeten2013-02-051-15/+16
| | | | | | | | | | | | | | | | | Change the 'ai_bits' in the boardinfo to 'ai_maxdata' so that the calculation of s->maxdata can be removed. Change the types for the analog input boardinfo to match the comedi_subdevice types they are set to. Rename the (*insn_read) function for the analog input subdevice from vmk80xx_ai_rinsn to vmk80xx_ai_insn_read to make grepping easier. For aesthetic reasons, add some whitespace to the subdevice init. 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>
* staging: comedi: vmk80xx: remove need for boardinfo in private_dataH Hartley Sweeten2013-02-051-35/+25
| | | | | | | | | | | | The only information in the boardinfo that is used outside of the attach of the driver is the 'model' of the device. Remove the 'board' pointer from the private data and replace it with the 'model' enum and just copy that information over during the attach. 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>
* staging: comedi: vmk80xx: push usb (*probe) into comedi (*auto_attach)H Hartley Sweeten2013-02-051-108/+55
| | | | | | | | | | | | | | | | | | | | | | | Make the usb_driver (*probe) simply call comedi_usb_auto_config() and move all the (*probe) code into the (*auto_attach) function. This allows getting rid of the static private data array since we no longer do part of the initialization in the (*probe) and then finish it in the (*auto_attach). We can simply kzalloc the private data instead. The comedi core will then handle the kfree of the data when the driver is detached. We can also get rid of the static 'glb_mutex' since this mutex was only used to protect the static private data array. Change the parameters for a couple of the helper functions used during the auto attach. Now that the comedi_device is available we can simply pass that pointer and get the specific pointers needed by the helper functions from it. 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>
* staging: comedi: comedi_usb: allow comedi usb drivers to pass a 'context'H Hartley Sweeten2013-02-056-7/+10
| | | | | | | | | | | Allow the comedi usb drivers to pass a 'context' from their (*probe) functions to the comedi core's comedi_usb_auto_config(). This 'context' is then passed to comedi_auto_config() and then to the comedi_driver's (*auto_attach). 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>
* staging: comedi: vmk80xx: remove private data 'attached'H Hartley Sweeten2013-02-051-7/+0
| | | | | | | | | | | | | | | | | | | | | The 'attached' flag in the private data is set after the comedi_driver (*auto_attach) function has completed successfully. The only places it's checked are in rudimentary_check(), which does some basic sanity checks before doing any of the subdevice operations, and vmk80xx_auto_attach(), which is the comedi_driver (*auto_attach) function. The (*auto_attach) function can only be called as the result of a successfull usb_driver (*probe). Part of the probe is to locate a free slot in the static private data array. All free slots are initialized to '0' so the 'attached' flag will always be cleared. Remove the unneccessary 'attached' flag in 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>
* staging: comedi: vmk80xx: remove private data 'probed'H Hartley Sweeten2013-02-051-7/+2
| | | | | | | | | | | | | | | | | | | | | | The 'probed' variable is used in the usb driver (*probe) to detect an unused element in the static private data arry. This variable is then set after the usb driver has completed its (*probe) before calling comedi_usb_auto_config(). When the comedi core does the auto config it will call the (*auto_attach) function, vmk80xx_auto_attach(), which then locates the correct private data in the static array by checking to see if it has been 'probed' and that the 'intf' variable matches the usb_interface pointer for the usb device. Now that the private data is clean after failed usb probes and disconnects we don't have to worry about have a garbage 'intf' value in the private data that might match. Remove the 'probed' flag from the private data and just use the 'intf' pointer to detect the match. 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>
* staging: comedi: vmk80xx: make sure private data is clean when detachedH Hartley Sweeten2013-02-051-14/+25
| | | | | | | | | | | | | | | | | | | | | Currently the private data used in this driver is stored in a static array. During the usb (*probe) and empty location is found in this array for use by the usb device. Some initialization of the private data is then done before comedi_usb_auto_config() is called to allow the comedi core to attach its comedi_device to the usb device. The (*probe) can fail for various reasons. If it does, make sure that the private data is clean before returning an error. The usb (*disconnect) simply calls comedi_usb_auto_unconfig() to allow the comedi core to disconnect its comedi_device from the usb device. Since the private data points to the static array it cannot be kfree'ed during the detach. Instead make sure it clean before leaving 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>
* staging: comedi: vmk80xx: remove private data 'count'H Hartley Sweeten2013-02-051-7/+0
| | | | | | | | | | | | The 'count' in the private data is only used in a couple dev_info() kernel messages. These messages are just added noise. Remove the 'count' variable in the private data as well as the dev_info() messages. 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>
* staging: comedi: vmk80xx: factor out usb buffer allocationH Hartley Sweeten2013-02-051-13/+22
| | | | | | | | Factor the code that allocates the usb buffers out of vmk80xx_usb_probe(). 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>
* staging: comedi: vmk80xx: factor out usb endpoint detectionH Hartley Sweeten2013-02-051-35/+39
| | | | | | | | | | Factor the code that detects the usb endpoints out of vmk80xx_usb_probe(). Cleanup the detection code in the new function, 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>
* staging: comedi: vmk80xx: consistently use the same local var namesH Hartley Sweeten2013-02-051-276/+290
| | | | | | | | | | | | | | | | Rename some of the local variables used in this driver to make the code easier to maintain and understand. s/udev/usb the usb_device that the comedi_driver is attached to s/dev/devpriv the private data of the comedi_device s/cdev/dev the comedi_device Also, use some local variables in a couple of the functions to tidy up the code a bit. 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>
* staging: comedi: vmk80xx: rename struct vmk80xx_usbH Hartley Sweeten2013-02-051-29/+29
| | | | | | | | | | The struct vmk80xx_usb is actually the private data for the comedi_device. For aesthetic reasons, rename the struct to vmk80xx_private. 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>
* staging: comedi: vmk80xx: remove VMK80XX_SUBD_* enumH Hartley Sweeten2013-02-051-15/+6
| | | | | | | | | | These enum values are only used in the initialization of the comedi_subdevices. They don't help make the code any clearer so just remove them. 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>
* staging: comedi: vmk80xx: remove common and unused boardinfoH Hartley Sweeten2013-02-051-18/+3
| | | | | | | | | | | | | Some of the information in the boardinfo is common for both boards supported by this driver. Remove that information from the boardinfo and just initialize the subdevice values directly. Also, remove any information in the boardinfo that is not used in 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>
* staging: comedi: vmk80xx: save the boardinfo in the comedi_deviceH Hartley Sweeten2013-02-051-39/+65
| | | | | | | | | | Save a copy of the boardinfo pointer in the comedi_device 'board_ptr'. The subdevice functions can then simply get it using the comedi_board() helper. 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>
* staging: comedi: vmk80xx: move boardinfo into a const arrayH Hartley Sweeten2013-02-051-75/+77
| | | | | | | | | | | | | | | The normal way of presenting the board specific information in comedi drivers is store the data in a static const array. This data is then accessed using a pointer, normally the comedi_device 'board_ptr', Move the boardinfo for the two boards supported by this driver from the vmk80xx_usb_probe() function into a static const array. Change the access of this information so a pointer is used. 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>
* staging: comedi: vmk80xx: use comedi_auto_unconfig() for (*disconnect)H Hartley Sweeten2013-02-051-9/+2
| | | | | | | | | | The usb_driver (*disconnect) in this driver is simply a wrapper around comedi_auto_unconfig(). Just use comedi_auto_unconfig() directly for the (*disconnect). 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>
* staging: comedi: vmk80xx: move usb_driver (*disconnect) codeH Hartley Sweeten2013-02-051-29/+20
| | | | | | | | | | | | The usb_driver (*disconnect) in this driver calls the comedi core comedi_usb_auto_unconfig() which calls the comedi_driver (*detach). Move the code in the (*disconnect) to the (*detach) to get all the disconnect/detach in one place. 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>
* staging: comedi: vmk80xx: remove support for manual attachingH Hartley Sweeten2013-02-051-22/+1
| | | | | | | | | | This comedi USB driver supports attaching with the auto config mechanism. Remove the manual attaching support using the COMEDI_DEVCONFIG ioctl. 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>
* staging: comedi: check s->async for poll(), read() and write()Ian Abbott2013-02-051-4/+4
| | | | | | | | | | | | | | | | | Some low-level comedi drivers (incorrectly) point `dev->read_subdev` or `dev->write_subdev` to a subdevice that does not support asynchronous commands. Comedi's poll(), read() and write() file operation handlers assume these subdevices do support asynchronous commands. In particular, they assume `s->async` is valid (where `s` points to the read or write subdevice), which it won't be if it has been set incorrectly. This can lead to a NULL pointer dereference. Check `s->async` is non-NULL in `comedi_poll()`, `comedi_read()` and `comedi_write()` to avoid the bug. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: remove 'comedi_autoconfig' module parameterH Hartley Sweeten2013-02-054-24/+1
| | | | | | | | | | | | | | | This module parameter is used to enable the auto config mechanism in the comedi core. Most of the PCI, PCMCIA, and USB drivers have been converted to use the auto config mechanism and will not attach if it is disabled. Since the 'comedi_autoconfig' parameter is defaulted to true, just remove it so that the comedi drivers that use auto config will always be able to attach. 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>
* staging: comedi: quatech_daqp_cs: factor out common ai scanlist codeH Hartley Sweeten2013-02-051-28/+24
| | | | | | | | | Factor the code that programs the analog input scanlist out of the daqp_ai_insn_read() and daqp_ai_cmd() 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>
* staging: comedi: quatech_daqp_cs: fix daqp_ao_insn_write()H Hartley Sweeten2013-02-051-13/+14
| | | | | | | | | | The (*insn_write) functions are expected to write 'insn->n' number of samples to the channel. Fix this function so it works as the comedi core expects. 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>
* staging: comedi: quatech_daqp_cs: use (*insn_bits) for digital outputsH Hartley Sweeten2013-02-051-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Change the subdevice operation used to write the digital outputs from a (*insn_write) to a (*insn_bits) function. The (*insn_write) functions are expected to write 'insn->n' number of samples. The (*insn_bits) functions just write a single sample (insn->n = 1). Change the return from '1' to 'insn->n' to clarify what the return is. Using an (*insn_bits) function to write the digital outputs also allows the user to read the current state of the output channels. Fix the io operation used to update the digital outputs. The register is only 8-bits and should by updated with an outb() not an outw(). Also, set the 'maxdata' for the subdevice. For digital io this value should be '1' (digital io can only be 1 or 0). Remove the setting of the len_chanlist for the subdevice. This variable only has meaning for subdevices that support asynchronous commands. The comedi core will initialize it appropriately during the postconfig. 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>
* staging: comedi: quatech_daqp_cs: use (*insn_bits) for digital inputsH Hartley Sweeten2013-02-051-6/+6
| | | | | | | | | | | | | | | Change the subdevice operation used to read the digital inputs from a (*insn_read) to a (*insn_bits) function. The (*insn_read) functions are expected to read 'insn->n' number of samples. The (*insn_bits) functions just read a single sample (insn->n = 1). Change the return from '1' to 'insn->n' to clarify what the return is. Also, set the 'maxdata' for the subdevice. For digital io this value should be '1' (digital io can only be 1 or 0). 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>
* staging: comedi: quatech_daqp_cs: remove unused defineH Hartley Sweeten2013-02-051-3/+0
| | | | | | | | The MAX_DEV define is no longer used in this driver. Remove it. 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>
* staging: comedi: quatech_daqp_cs: rename the private data structH Hartley Sweeten2013-02-051-47/+40
| | | | | | | | | | | | | The private data in this driver is associated with the comedi_device pointer not the pcmcia_device. For aesthetic reasons, rename the private data struct from local_into_t to daqp_private. Also, rename the local variables used for the private data from local to devpriv as that is more common in the comedi drivers. 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>
OpenPOWER on IntegriCloud