Commit Graph

376960 Commits

Author SHA1 Message Date
H Hartley Sweeten 44d3fcaece staging: comedi: usbduxsigma: cleanup the private data 'outBuffer'
This buffer is used to cache the analog output values that are written
to the analog output channels. Currently it only caches the single
writes to the channels using the (*insn_write) callback. The async
command writes are not cached. The buffer is also being kzalloc'ed
during the attach of the driver to a size much larger that required.

Rename the CamelCase buffer and change it to an array in the private
data of the correct size to cache the analog output channel values.

Modify the analog output urb callback so it updates the cached values
with those used for the asynchronous command to allow readback after
the command completes.

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>
2013-05-30 20:41:07 +09:00
H Hartley Sweeten 2dd87acb1a staging: comedi: usbduxsigma: tidy up analog output (*insn_{read, write})
Rename the functions so they have namespace associated with the driver.
Rename the local variable used for the private data pointer.

Return -EBUSY from the (*insn_write) function if an asynchronous command
is running that the write cannot be completed.

Don't save the cached value of the analog output for readback unless
the command to set it is successful.

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>
2013-05-30 20:41:07 +09:00
H Hartley Sweeten fb1ef622e7 staging: comedi: usbduxsigma: tidy up analog output command support
Rename the (*do_cmdtest) and (*do_cmd) functions so they have namespace
associated with the driver. Rename the local variable used for the
private data pointer.

Move all the command argument initialization and testing into the
(*do_cmdtest) function. That function is always called by the comedi
core before the (*do_cmd) function. The only thing the (*do_cmd) function
should have to do is setup the channel list, initialize the counter for
the conversion, then either start the conversion (submit the urbs) or
set the trigger to start the conversion.

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>
2013-05-30 20:41:06 +09:00
H Hartley Sweeten 8cd6f5ebb6 staging: comedi: usbduxsigma: rename usbdux_pwm_stop()
Rename the function so it has namespace associated with the driver.

For aesthetic reasons, pass the comedi_device pointer instead of the
private data pointer as the first parameter.

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>
2013-05-30 20:41:06 +09:00
H Hartley Sweeten fd245192b1 staging: comedi: usbduxsigma: rename usbdux_pwm_cancel()
Rename the function 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>
2013-05-30 20:41:06 +09:00
H Hartley Sweeten aff4dd068c staging: comedi: usbduxsigma: rename usbdux_pwm_irq()
Rename the function 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>
2013-05-30 20:41:05 +09:00
H Hartley Sweeten 440b2168ae staging: comedi: usbduxsigma: tidy up usbdux_pwm_period()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.

Modify the fx2delay calculation to remove the floating point values.

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>
2013-05-30 20:41:05 +09:00
H Hartley Sweeten cf9b463401 staging: comedi: usbduxsigma: change private data flags to bit fields
Change the type of all the true/false flags in the private data to
bit fields.

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>
2013-05-30 20:41:04 +09:00
H Hartley Sweeten 92ba10e1a1 staging: comedi: usbduxsigma: remove 'interface' from the private data
This back pointer to the usb_interface is not used, 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>
2013-05-30 20:41:04 +09:00
H Hartley Sweeten 38f4e42153 staging: comedi: usbduxsigma: remove some dev_{level} noise
Remove the dev_err() and dev_dbg() messages that are just kernel
noise.

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>
2013-05-30 20:41:04 +09:00
H Hartley Sweeten 62f85edb3d staging: comedi: usbduxsigma: tidy up usbdux_dio_insn_config()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Add a local variable for the channel mask.

Remove the unnecessary comments and clean up the multi-line comment
at the end.

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>
2013-05-30 20:41:03 +09:00
H Hartley Sweeten 77a52e69cb staging: comedi: usbduxsigma: tidy up usbdux_dio_insn_bits()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Remove the unnecessary casts.

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>
2013-05-30 20:41:03 +09:00
H Hartley Sweeten a65b091554 staging: comedi: usbduxsigma: tidy up usbdux_pwm_start()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.

Remove the unnecessary cast of the pwm delay.

Use memset to initialize the buffer instead of the for loop.

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>
2013-05-30 20:41:03 +09:00
H Hartley Sweeten ab58a6e35d staging: comedi: usbduxsigma: tidy up usbdux_pwm_pattern()
Rename the function so it has namespace associated with the driver.

Tidy up the function to make it more concise.

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>
2013-05-30 20:41:02 +09:00
H Hartley Sweeten 4ced8c641e staging: comedi: usbduxsigma: tidy up usbdux_pwm_write()
Rename the function so it has namespace associated with the driver.

Tidy up the comments.

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>
2013-05-30 20:41:01 +09:00
H Hartley Sweeten 92f687ba5e staging: comedi: usbduxsigma: remove usbdux_pwm_read()
The comment says its not needed, just 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>
2013-05-30 20:41:01 +09:00
H Hartley Sweeten 8939787fe0 staging: comedi: usbduxsigma: tidy up usbduxsigma_pwm_config()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.

Remove some unnecessary comments and tidy up the comment about the
parameters for the INSN_CONFIG_PWM_SET_H_BRIDGE instruction.

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>
2013-05-30 20:41:00 +09:00
H Hartley Sweeten 46c878080b staging: comedi: usbduxsigma: move usbduxsigma_firmware_upload()
For aesthetics, move this function near its caller. Also, move the
FIRMWARE_MAX_LEN define so its with the other firmware constants
and fix the whitespace.

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>
2013-05-30 20:41:00 +09:00
H Hartley Sweeten 5f1d72ecfb staging: comedi: usbduxsigma: remove an extra ';'
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>
2013-05-30 20:40:59 +09:00
H Hartley Sweeten e0b12e6e9a staging: comedi: usbduxsigma: tidy up tidy_up()
Rename the function so it has namespace associated with the driver.

For aesthetic reasons, move the function so it's near the one that
allocates the usb buffers.

Tidy up the function so it frees the buffers in the opposite order
they were allocated. Also remove the = NULL for all the buffers,
the driver is being detached so the comedi core will kfree 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>
2013-05-30 20:40:58 +09:00
H Hartley Sweeten 988f5541db staging: comedi: usbduxsigma: kill all urbs before freeing them
For aesthetic reasons, kill all the urbs before freeing them.
Also, remove a redundant killing of the ai and ao urbs in 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>
2013-05-30 20:40:58 +09:00
H Hartley Sweeten 137beb77c7 staging: comedi: usbduxsigma: move usb_set_intfdata(intf, NULL) to (*detach)
For aesthetic reasons, move the clearing of the interface data to
the (*detach) since its set in the (*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>
2013-05-30 20:40:58 +09:00
H Hartley Sweeten 1fc56e86e4 staging: comedi: usbduxsigma: remove tidy_up() from (*auto_attach)
Comedi drivers do not need to cleanup allocations during the
(*auto_attach). If the (*auto_attach) fails the (*detach) will
automatically be called to handle the cleanup.

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>
2013-05-30 20:40:57 +09:00
H Hartley Sweeten 9838f532dc staging: comedi: usbduxsigma: tidy up usbdux_getstatusinfo()
Rename the function so it has namespace associated with the driver.

Move the function closer to its only caller and tidy it up 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>
2013-05-30 20:40:57 +09:00
H Hartley Sweeten 78f48506f5 staging: comedi: usbduxsigma: tidy up usbduxsigma_attach_common()
Rename the local variable used for the comedi_device private data.

Remove all the unnecessary comments and add some whitespace to the
subdevice init.

Use dev->class_dev for the dev_{level} 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>
2013-05-30 20:40:56 +09:00
H Hartley Sweeten af87e18890 staging: comedi: usbduxsigma: remove SUBDEV_* defines
The SUBDEV_* defines are only used during the (*auto_attach). Remove
the defines and just open code the values.

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>
2013-05-30 20:40:56 +09:00
H Hartley Sweeten 982d255b3e staging: comedi: usbduxsigma: remove unnecessary check in usbdux_ao_cmd()
The comedi core verifies that the command chanlist_len is valid for
the subdevice based on the len_chanlist that was setup during the
attach. There is no need to recheck it in the (*cmd) 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>
2013-05-30 20:40:55 +09:00
H Hartley Sweeten 01a4303d39 staging: comedi: usbduxsigma: remove unnecessary check in usbdux_ai_cmd()
The comedi core verifies that the command chanlist_len is valid for
the subdevice based on the len_chanlist that was setup during the
attach. There is no need to recheck it in the (*cmd) 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>
2013-05-30 20:40:54 +09:00
H Hartley Sweeten 8eea6dbd73 staging: comedi: usbduxsigma: tidy up usbdux_ai_inttrig()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.

Remove the dev_err() messages, they are just added noise.

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>
2013-05-30 20:40:54 +09:00
H Hartley Sweeten 2d4462d28a staging: comedi: usbduxsigma: tidy up usbdux_ao_inttrig()
Rename the function so it has namespace associated with the driver.

Rename the local variable used for the private data pointer.

Remove the dev_err() messages, they are just added noise.

Refactor the code to remove the goto.

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>
2013-05-30 20:40:54 +09:00
H Hartley Sweeten edd2d33ee8 staging: comedi: usbduxsigma: remove private data sanity checks
The comedi functions in this driver can only be called if the
(*auto_attach) successfull kzalloc'ed the private data and set
dev->private. The extra sanity checks are not needed. 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>
2013-05-30 20:40:54 +09:00
H Hartley Sweeten 2a8cdc6861 staging: comedi: usbduxsigma: tidy up firmware upload error messages
Use dev->class_dev for all dev_{level} messages.

Remove the unnecessary error message for a kmemdup() failure.

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>
2013-05-30 20:40:53 +09:00
H Hartley Sweeten a59a28a32f staging: comedi: usbduxsigma: remove 'usbdev' from the private data
This back pointer to the usb_device is not needed in the private data.
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>
2013-05-30 20:40:53 +09:00
H Hartley Sweeten f62024e5ae staging: comedi: usbduxsigma: remove 'comedidev' from the private data
This back pointer to the comedi_device is not needed in the private
data. 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>
2013-05-30 20:40:53 +09:00
H Hartley Sweeten 6028f4c01c staging: comedi: usbduxsigma: tidy up usbduxsub_submit_PwmURBs()
Rename the CamelCase function.

Pass the comedi_device pointer instead of the private data pointer
to the function.

Use a couple local variables to tidy up the function.

Remove the dev_err() message when usb_submit_urb() fails, its just
added noise.

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>
2013-05-30 20:40:53 +09:00
H Hartley Sweeten 125a77fcf5 staging: comedi: usbduxsigma: tidy up receive_dux_commands()
Rename the variable used for the private data pointer.

Remove dev_err() when usb_blk_msg() fails, it's just added noise.

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>
2013-05-30 20:40:52 +09:00
H Hartley Sweeten 502f9a3f76 staging: comedi: usbduxsigma: tidy up send_dux_commands()
Rename the variable used for the private data pointer.

Remove dev_err() when usb_blk_msg() fails, it's just added noise.

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>
2013-05-30 20:40:52 +09:00
H Hartley Sweeten 160343e52c staging: comedi: usbduxsigma: remove NOISY_DUX_DEBUGBUG
This define enables a bunch of printk debug in send_dux_commands().
This is just noise used for development debuging. 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>
2013-05-30 20:40:50 +09:00
H Hartley Sweeten 1823fcbfad staging: comedi: usbduxsigma: push usb (*probe) into comedi (*auto_attach)
The usb_driver (*probe) already calls comedi_usb_auto_config(), which
will call the comedi_driver (*auto_attach). Move the bulk of the (*probe)
to the (*auto_attach).

This allows the comedi_device private data to be kzalloc'ed and the static
array used to pass the private data from the usb_driver to the comedi_driver
can be removed along with the static semaphore that protected it.

We can also drop a couple variables from the private data since they no
longer are used or needed.

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>
2013-05-30 20:40:50 +09:00
H Hartley Sweeten 9319d4ab44 staging: comedi: usbduxsigma: push usb (*disconnect) into comedi (*detach)
The usb_driver (*disconnect) already calls comedi_usb_auto_unconfig(), which
will call the comedi_driver (*detach). Move the other operations in the
(*disconnect) into the (*detach). The comedi_usb_auto_unconfig() can then
be used 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>
2013-05-30 20:40:49 +09:00
H Hartley Sweeten 65989c030b staging: comedi: usbduxsigma: factor usb buffer allocation out of (*probe)
To make pushing the usb_driver (*probe) into the comedi_driver (*auto_attach)
cleaner, factor the usb buffer allocation out of the (*probe). This also
cleans up the failure paths in the (*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>
2013-05-30 20:40:49 +09:00
H Hartley Sweeten 902add47de staging: comedi: usbduxsigma: tidy up usbduxsigma_usb_probe()
For aesthetic reasons, rename some of the variables to the "norm" used
in comedi drivers.

Use a local variable for the pointer to the private data instead of
accessing the static array directly. Also use a local variable to
setup the urbs.

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>
2013-05-30 20:40:48 +09:00
H Hartley Sweeten eead8c6633 staging: comedi: usbduxsigma: rename the private data struct
For aesthetic reasons, rename the struct used for the comedi_device
private data from usbduxsub to usbduxsigma_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>
2013-05-30 20:40:48 +09:00
H Hartley Sweeten 7fb13b5436 staging: comedi: usbduxsigma: tidy up usbduxsub_pwm_irq()
Rename the local variables to follow the "norm" for comedi drivers.
The comedi_subdevice is not used in this function. Remove that local
variable.

Use dev->class_dev for any dev_{level} messages.

Remove the extra check of 'pwm_cmd_running' before submitting the urb.
This flag was previously checked.

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>
2013-05-30 20:40:48 +09:00
H Hartley Sweeten 990a049d8b staging: comedi: usbduxsigma: remove 'probed' checks in comedi functions
The 'probed' flag in the private data is used by the usb_driver (*probe)
function to find a free entry in the static usbduxsub array to use for
the comedi_device private data. The (*probe) sets this flag before it
hands off the probe to the comedi_driver (*auto_attach). The 'probed'
flag is cleared in tidy_up() are part of the usb_driver (*disconnect),
which calls the comedi_driver (*detach).

The 'probed' flag will always be set if the comedi_driver (*auto_attach)
completes successfully. The extra sanity checks in the comedi functions
are not needed. 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>
2013-05-30 20:40:46 +09:00
H Hartley Sweeten de0a1e971f staging: comedi: usbduxsigma: generalize the usb_submit_urb functions
Generalize a helper function to replace usbduxsub_submit_{In,Out}URBs().

In the callers, set the 'a[io]_cmd_running' flag after the urbs have been
successfully submitted. This removes the need to clear the flag if the
submit fails.

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>
2013-05-30 20:40:46 +09:00
H Hartley Sweeten 91fe97f3a3 staging: comedi: usbduxsigma: remove dev_{level} messages in submit urbs functions
The usbduxsub_submit_{In,Out}URBs() functions have a couple development
debug messages that are just added noise. Remove them.

Also, the sanity check of 'usbduxsub', the comedi_device private data, is
not necessary. The callers have already validated it. Remove the checks.

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>
2013-05-30 20:40:45 +09:00
H Hartley Sweeten 641b78f367 staging: comedi: usbduxsigma: tidy up usbduxsub_ao_IsocIrq()
Rename the local variables to follow the "norm" for comedi drivers.
The comedi_subdevice for this function is the dev->write_subdev that
was initialized during the (*auto_attach), use that instead of
directly accessing the comedi_device subdevices array.

Use dev->class_dev for any dev_{level} messages.

Remove the extra check of 'ao_cmd_running' before submitting the urb.
This flag was previously checked and if the command is aborted due to
an usbdux_ao_stop() before reaching this point the function will exit.

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>
2013-05-30 20:40:45 +09:00
H Hartley Sweeten 147b25a3cc staging: comedi: usbduxsigma: tidy up usbduxsub_ai_IsocIrq()
Rename the local variables to follow the "norm" for comedi drivers.
The comedi_subdevice for this function is the dev->read_subdev that
was initialized during the (*auto_attach), use that instead of
directly accessing the comedi_device subdevices array.

Use dev->class_dev for any dev_{level} 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>
2013-05-30 20:40:44 +09:00
H Hartley Sweeten f31260f9c8 staging: comedi: usbduxsigma: absorb usbduxsub_unlink_PwmURBs() into caller
This function is only called by usbdux_pwm_stop(). Absorb 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>
2013-05-30 20:40:44 +09:00