summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
AgeCommit message (Collapse)Author
2013-08-22staging: comedi: pcmuio: fix possible NULL deref on detachIan Abbott
pcmuio_detach() is called by the comedi core even if pcmuio_attach() returned an error, so `dev->private` might be `NULL`. Check for that before dereferencing it. Also, as pointed out by Dan Carpenter, there is no need to check the pointer passed to `kfree()` is non-NULL, so remove that check. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-22staging: comedi: pcmmio: remove unneeded checks on detachIan Abbott
As pointed out by Dan carpenter for the similar pcmuio driver, there is no need to check the pointer passed to `kfree()`, so remove that check from `pcmmio_detach()`. Also, check the `devpriv` (`dev->private`) pointer once, outside the `for` loop. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21staging: comedi: pcl812: missing break statementDan Carpenter
Smatch complains that there is a missing break statement here. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21staging: comedi: dt282x: dt282x_ai_insn_read() always failsDan Carpenter
In dt282x_ai_insn_read() we call this macro like: wait_for(!mux_busy(), comedi_error(dev, "timeout\n"); return -ETIME;); Because the if statement doesn't have curly braces it means we always return -ETIME and the function never succeeds. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Ian Abbott <abbotti@mev.co.uk> Cc: stable <stable@vger.kernel.org> # 2.6.36+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21staging: comedi: usbdux: allocating too much dataDan Carpenter
We only need to allocate enough space for a pointer. We allocate the space for the urbs themselves with the call to usb_alloc_urb() a few lines later. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14drivers/staging/comedi/drivers/das16.c: needs slab.hAndrew Morton
alpha allmodconfig: drivers/staging/comedi/drivers/das16.c: In function 'das16_detach': drivers/staging/comedi/drivers/das16.c:1234: error: implicit declaration of function 'kfree' Cc: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12staging: comedi: drivers: use comedi_dio_insn_config() for simple casesH Hartley Sweeten
Convert the drivers with simple, per channel programmable i/o, to use the comedi_dio_insn_config() helper function. All of these pass a 'mask' of '0' to comedi_dio_insn_config() this causes the per channel mask to be used to configure the i/o direction. 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>
2013-08-12staging: comedi: skel: use comedi_dio_insn_config()H Hartley Sweeten
Convert this driver to use the comedi_dio_insn_config() helper function. Tidy up the comments to reflect the new code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12staging: comedi: drivers: introduce comedi_dio_insn_config()H Hartley Sweeten
DIO subdevices always handle the INSN_CONFIG_DIO_{INPUT,OUTPUT} instructions to configure the DIO channels. They also always handle the INSN_CONFIG_DIO_QUERY instruction to query the configuration of a DIO channel. Introduce a helper function to handle the (*insn_config) boilerplate for comedi DIO subdevices. This function has the same paramters as (*insn_config) functions with an additional parameter to allow the caller to pass a 'mask' value for grouped DIO channels. This function returns: 0 if the instruction was successful but requires additional handling by the caller (INSN_CONFIG_DIO_{INPUT,OUTPUT} insn->n if the instruction was handled (INSN_CONFIG_DIO_QUERY) -EINVAL for all unhandled instructions The caller is responsible for actually configuring the hardware based on the configuration (s->io_bits). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12Revert "staging: comedi: skel: use comedi_dio_insn_config()"Greg Kroah-Hartman
This reverts commit 42ef678bef336a83fd0ae0b03a56c0a93665a18b. It's incorrect as well... time for more coffee... Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12Revert "staging: comedi: core: introduce comedi_dio_insn_config()"Greg Kroah-Hartman
This reverts commit 4f76463d3b8f8cc0cac5bb292ec766848f3f4fa1. I applied an incorrect version here as well :( Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12staging: comedi: drivers: use comedi_dio_insn_config() for complex casesH Hartley Sweeten
Convert the drivers with complex, port programmable i/o, to use the comedi_dio_insn_config() helper function. All of these drivers have some sort of 'port' programmable i/o where multiple i/o channels are configured as a group. The 'mask' associated with the group is passed to comedi_dio_insn_config() so that all the channels are configured. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12Revert "staging: comedi: drivers: use comedi_dio_insn_config() for complex ↵Greg Kroah-Hartman
cases" This reverts commit f21c53945cb95f66faa9636af5f23cb00ba73019. I applied the wrong patch :( Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12staging: comedi: drivers: use comedi_dio_insn_config() for complex casesH Hartley Sweeten
Convert the drivers with complex, port programmable i/o, to use the comedi_dio_insn_config() helper function. All of these drivers have some sort of 'port' programmable i/o where multiple i/o channels are configured as a group. The 'mask' associated with the group is passed to comedi_dio_insn_config() so that all the channels are configured. 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>
2013-08-12staging: comedi: skel: use comedi_dio_insn_config()H Hartley Sweeten
Convert this driver to use the comedi_dio_insn_config() helper function. Tidy up the comments to reflect the new 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>
2013-08-12staging: comedi: core: introduce comedi_dio_insn_config()H Hartley Sweeten
DIO subdevices always handle the INSN_CONFIG_DIO_{INPUT,OUTPUT} instructions to configure the dio channels. They also always handle the INSN_CONFIG_DIO_QUERY instruction to query the configuration of a dio channel. Introduce a helper function to handle the (*insn_config) boilerplate for comedi DIO subdevices. This function has the same parameters as (*insn_config) functions with an additional parameter to allow the caller to pass a 'mask' value for grouped dio channels. This function returns: 0 if the instruction was successful but requires additional handling by the caller (INSN_CONFIG_DIO_{INPUT,OUTPUT} insn->n if the instruction was handled (INSN_CONFIG_DIO_QUERY) -EINVAL for all unhandled instructions The caller is responsible for actually configuring the hardware based on the configuration (s->io_bits). 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>
2013-08-01staging: comedi: dt9812: Resolve different base types warnings.Shaun Laing
Resolves warnings from the "sparse" checker of the form "warning: incorrect type in assignment (different base types)". Signed-off-by: Shaun Laing <shaun@xresource.ca> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01staging: comedi: allow ISA and PC/104 drivers on non-ISA systemsH Hartley Sweeten
Embedded systems with a PC/104 bus might have a configuration that does not have ISA enabled. This creates a problem in Comedi where the PC/104 drivers cannot be enabled. Remove the 'depends on ISA' for the "Comedi ISA and PC/104 drivers" menu to allow the user to select these drivers on non-ISA systems. 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>
2013-08-01staging: comedi: usbduxsigma: absorb usbduxsigma_attach_common() into callerH Hartley Sweeten
This function is only called by usbduxsigma_auto_attach(). Absorb it and refactor the code a bit to match the usbdux driver. 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>
2013-08-01staging: comedi: usbdux: tidy up usbdux_free_usb_buffers()H Hartley Sweeten
For aesthetics, pass the comedi_device pointer to this function instead of the private data pointer. The usb_kill_urb() calls are not needed. All the urbs were unlinked before this function was called. 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>
2013-08-01staging: comedi: usbdux: tidy up usbdux_detach()H Hartley Sweeten
Make sure the usb intfdata is always cleared when the device is detached. Refactor the code to remove an indent level. Always unlink the urbs when the device is detached. 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>
2013-08-01staging: comedi: usbduxsigma: always clear the usb intfdata in (*detach)H Hartley Sweeten
Make sure the usb intfdata is always cleared when the device is detached. 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>
2013-08-01staging: comedi: usbduxsigma: move urb unlink into usbduxsigma_detach()H Hartley Sweeten
For aesthetics, move the final force unlink of the urbs from usbduxsigma_free_usb_buffers() to usbduxsigma_detach(). 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>
2013-08-01staging: comedi: usbduxsigma: init 'pwm_buf_sz' in usbduxsigma_auto_attach()H Hartley Sweeten
Initialize this variable with then_ai_urbs and n_ao_urbs in the attach. Then usbduxsigma_alloc_usb_buffers() can just check the variable to determine if the urb needs to be allocated. 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>
2013-08-01staging: comedi: usbduxsigma: 'dac_commands' does not need to be kzalloc()'dH Hartley Sweeten
The 'dac_commands' buffer is used to pass the ao channel list from usbduxsigma_ao_cmd() to the urb callback, usbduxsigma_ao_urb_complete(). This buffer does not need to be allocated. Change it into a simple array of the correct size. Rename the variable to 'ao_chanlist' to clarify what it actually is. 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>
2013-08-01staging: comedi: usbdux: tidy up usbdux_alloc_usb_buffers()H Hartley Sweeten
Tidy up the error path by doing all the basic allocations then checking for failures. We have the comedi device now so fill in the urb->context. 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>
2013-08-01staging: comedi: usbduxsigma: return void from usbduxsigma_pwm_pattern()H Hartley Sweeten
This function never fails and currently returns '1' so that the usbduxsigma_pwm_write() function returns to proper value (insn->n). It's also called by usbduxsigma_pwm_config() which also returns the '1' value. The proper return code for this function should be '0' to indicate success. Change the return type of the function to void and just have the callers return the proper values. 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>
2013-08-01staging: comedi: usbdux: return void from usbdux_pwm_pattern()H Hartley Sweeten
This function never fails and currently returns '1' so that the usbdux_pwm_write() function returns to proper value (insn->n). It's also called by usbdux_pwm_config() which also returns the '1' value. The proper return code for this function should be '0' to indicate success. Change the return type of the function to void and just have the callers return the proper values. 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>
2013-08-01staging: comedi: usbdux: tidy up usbdux_pwm_config()H Hartley Sweeten
Rename the local variable used for the private data pointer to 'devpriv'. Tidy up the function a bit. 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>
2013-08-01staging: comedi: usbdux: remove usbdux_pwm_read()H Hartley Sweeten
The pwm subdevice is not readable so this callback function is not needed. 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>
2013-08-01staging: comedi: usbdux: tidy up usbdux_pwm_write()H Hartley Sweeten
Remove the sanity check of the private data. This function can only be called if the private data was successfully allocated in the attach. Tidy up the function a bit. 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>
2013-08-01staging: comedi: usbdux: tidy up usbdux_pwm_pattern()H Hartley Sweeten
Rename the local variable used for the private data pointer to 'devpriv'. Remove the sanity check of the private data. This function can only be called if the private data was successfully allocated in the attach. Tidy up the function to make it more concise. 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>
2013-08-01staging: comedi: usbdux: tidy up usbdux_pwm_period()H Hartley Sweeten
Rename the local variable used for the private data pointer to 'devpriv'. Fix the fx2delay calculation so it does not use floating point values. 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>
2013-08-01staging: comedi: usbduxsigma: remove the usb endpoint definesH Hartley Sweeten
The endpoint defines are each only used in one place and don't help clarify the code. Remove the defines and just open code the values. 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>
2013-08-01staging: comedi: usbduxsigma: generalize the ai/ao usb_kill_urb()H Hartley Sweeten
Generalize a helper function to replace for() loops in usbduxsigma_{ai,ao}_stop() that call usb_kill_urb() to unlink all the urbs. 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>
2013-08-01staging: comedi: usbdux: generalize the usb_submit_urb functionsH Hartley Sweeten
Generalize a helper function to replace usbduxsub_submit_{in,out}urbs(). 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>
2013-08-01staging: comedi: das16: tidy up multi-line commentsH Hartley Sweeten
Tidy up the multi-line comments 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>
2013-08-01staging: comedi: das16: remove some unnecessary parenthesesH Hartley Sweeten
These parentheses are not necessary. 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>
2013-08-01staging: comedi: das16: tidy up user ai/ao range initializationH Hartley Sweeten
The allocation of the user range tables could fail. Make sure to check for it. Change the kmalloc()'s to kzalloc()'s to make sure the allocated range tables are initialized to a known state. Change the local variables so they can be used for both the ai and ao range initialization and use shorter names to keep the lines < 80 chars. 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>
2013-08-01staging: comedi: das16: remove an unnecessary check in the attachH Hartley Sweeten
If the user does not specify the analog output range the private data 'user_ao_range_table' will not be allocated. The comedi core will detect the NULL s->range_table and automatically set it to &range_unknown. 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>
2013-08-01staging: comedi: das16: fix das16_detach()H Hartley Sweeten
The function das16_reset() needs a valid dev->iobase. Since the iobase is requested after the devpriv has been allocated in the attach, move the das16_reset() call into the if (devpriv) and add a if (dev->iobase). Also, move the release of the extra iobase into the if (devpriv) to prevent an invalid memory access. 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>
2013-08-01staging: comedi: das16: change MODULE_DESCRIPTIONH Hartley Sweeten
Change the MODULE_DESCRIPTION to something useful instead of the generic "Comedi low-level driver". 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>
2013-08-01staging: comedi: das16: tidy up private data definitionH Hartley Sweeten
Remove the comments and add some whitespace to help readability. 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>
2013-08-01staging: comedi: das16: cleanup comedi_error() messagesH Hartley Sweeten
Some of these messages are missing the terminating '\n' and most of them have the quoted string split across lines. Change all of them to dev_err() messages and fix the issues. 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>
2013-08-01staging: comedi: das16: fix a > 80 char line issueH Hartley Sweeten
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>
2013-08-01staging: comedi: das16: absorb das1600_mode_detect() into callerH Hartley Sweeten
This function is only called during the board attach to determine the pacer clock speed for the boards capable of bursting. Absorb it into the caller and remove the attach noise. 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>
2013-08-01staging: comedi: das16: cleanup printk message in board attachH Hartley Sweeten
Convert this printk message into a dev_err(). 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>
2013-08-01staging: comedi: das16: fail attach if board id is incorrectH Hartley Sweeten
This driver probes the board id during the attach to ensure that the user is attempting to attach to the correct board type. Currently an error message is output if the ids are not consistent but the attach continues anyway. Make the attach fail if the id bits do not match. Also, cleanup the printk messages and use a dev_err() only if the probe fails. 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>
2013-08-01staging: comedi: das16: tidy up the register map definesH Hartley Sweeten
Add the suffix _REG to all the register defines to better indicate what they are. Add a prefix to all the register bit defines to avoid namespace clashes and to better indicate what they are. Tidy up the whitesapce. 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>
2013-08-01staging: comedi: das16: tidy up 8255 digital i/o subdeviceH Hartley Sweeten
The 8255 digital i/o subdevice is only available on some of the boards supported by this driver. Currently the 'i8255_offset' member of the boardinfo is used to indicate that it is available. To clarify this support, add a 'has_8255' bit-field flag to the boardinfo. We can then use this flag to conditionally allocate the space for the subdevice only when it is needed. Also, make sure to check that subdev_8255_init() is successful and propagate any errors. 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>