H Hartley Sweeten [Mon, 2 Jul 2012 22:45:34 +0000 (15:45 -0700)]
staging: comedi: das08_cs: refactor the pcmcia support code
Refactor the pcmcia support code to remove the need for the
forward declarations.
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>
H Hartley Sweeten [Mon, 2 Jul 2012 22:45:03 +0000 (15:45 -0700)]
staging: comedi: das08_cs: cleanup and remove useless comments
Move the comment about the PCMCIA support and reword it a bit
because of the move.
Remove a number of useless 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>
H Hartley Sweeten [Mon, 2 Jul 2012 22:44:30 +0000 (15:44 -0700)]
staging: comedi: das08_cs: cleanup the pcmcia_driver declaration
For aesthetic reasons, add some whitespace to the declaration
of the pcmcia_driver and reorder it a bit.
Also, the symbol 'das08_cs_driver' is only referenced in this file,
make it static. This quiets the following sparse warning:
warning: symbol 'das08_cs_driver' was not declared. Should it be static?
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>
H Hartley Sweeten [Mon, 2 Jul 2012 22:43:52 +0000 (15:43 -0700)]
staging: comedi: das08_cs: change driver registration order
As done with the other comedi driver types, register the
comedi_driver first then the pcmcia_driver. Also, make sure
the pcmcia_driver registration succeeds and unregister the
comedi_driver if it 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>
H Hartley Sweeten [Mon, 2 Jul 2012 22:43:19 +0000 (15:43 -0700)]
staging: comedi: das08_cs: consolidate the init and exit functions
The register/unregister of the pcmcia driver is done in separate
functions that are called by the module_{init,exit} routines.
Simplify the code a bit by moving the register/unregister into
the module_{init,exit} routines.
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>
H Hartley Sweeten [Mon, 2 Jul 2012 22:42:41 +0000 (15:42 -0700)]
staging: comedi: das08_cs: move the MODULE_* stuff to the EOF
Move the MODULE_* declarations to the end of the file.
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>
H Hartley Sweeten [Fri, 29 Jun 2012 18:02:59 +0000 (11:02 -0700)]
staging: comedi: das_08: absorb i8254_struct into the private data
The i8254_struct now only contains the iobase address used to
read/write the 8254 timer device. Move that variable into the
das08 private data struct and remove the i8254_struct.
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>
H Hartley Sweeten [Fri, 29 Jun 2012 18:02:02 +0000 (11:02 -0700)]
staging: comedi: das_08: remove the unneeded 8254 variables and defines
Now that the driver is using the 8253 helper functions, remove the
unused variables in the i8254_struct as well as the unused defines
for the 8254 register offsets.
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>
H Hartley Sweeten [Fri, 29 Jun 2012 18:01:22 +0000 (11:01 -0700)]
staging: comedi: das_08: remove the 8254 'channels' usage
The internal 8254 'channels' count is the same as the comedi
subdevice 'n_chan'. There is no need to keep the internal
count.
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>
H Hartley Sweeten [Fri, 29 Jun 2012 18:00:40 +0000 (11:00 -0700)]
staging: comedi: das_08: remove the 8254 'logic2phys' usage
The three 8254 timers have a 1:1 relationship to the comedi
channels. The 'logic2phys' usage just makes the driver more
complex.
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>
H Hartley Sweeten [Fri, 29 Jun 2012 17:59:55 +0000 (10:59 -0700)]
staging: comedi: das_08: remove the cached 8254 'mode'
The driver initially sets all the cached 'mode' values for the
8254 timers to (I8254_MODE0 | I8254_BINARY). It then sets the
timers to that 'mode'. Configuring the counters with the comedi
INSN_CONFIG_SET_COUNTER_MODE updates the 'mode' and then sets
the timers to the 'mode'. The cached value is never read or
used other than for storage.
Just remove the 'mode' usage as it serves no purpose.
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>
H Hartley Sweeten [Fri, 29 Jun 2012 17:59:21 +0000 (10:59 -0700)]
staging: comedi: das_08: unwind the 8254 timer support
Refactor the 8254 timer support by removing the various functions
that handle the io and consolidating the logic into the initialize,
read, write, and config functions used by 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>
H Hartley Sweeten [Fri, 29 Jun 2012 17:58:41 +0000 (10:58 -0700)]
staging: comedi: das_08: use the 8253 helper functions
Instead of open-coding the 8254 timer io, use the helper functions
provided by 8253.h.
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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:41:47 +0000 (17:41 -0700)]
staging: comedi: ni_670x: removve unused 'ao_bits'
All the NI 670x boards have 16-bit anaolog output DACs. The
'ao_bits' in the boardinfo is not used so 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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:41:10 +0000 (17:41 -0700)]
staging: comedi: ni_670x: cleanup ni_670x_dio_insn_bits()
Add local variable for the io_addr, mask. and bits used in this
function so that the comments are not needed and the writel/readl
calls are a bit cleaner.
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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:40:23 +0000 (17:40 -0700)]
staging: comedi: ni_670x: cleanup the boardinfo
For aesthetic reasons, reorder the boardinfo struct so that the
'name' pointer is first. Also, add some whitespace to the boardinfo
to improve readability.
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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:39:45 +0000 (17:39 -0700)]
staging: comedi: ni_670x: fix dereference of an invalid pointer
The attach if this driver can fail before the subdevices are
allocated. If the attach fails the comedi core will call the
detach routine to allow the driver to do it's cleanup.
We need to make sure that the subdevice allocation was successful
before trying to dereference subdevice[0] to free the allocated
range table list.
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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:38:54 +0000 (17:38 -0700)]
staging: comedi: ni_670x: return '0' for successful attach
The comedi core expects a < 0 value during the attach to indicate
an error. The normal 'success' return for the kernel is '0' so use
that here.
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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:38:18 +0000 (17:38 -0700)]
staging: comedi: ni_670x: change printk's to cleaned up dev_printk's
Convert all the prink's in this file to dev_prink's.
Change the INFO message in ni_670x_find_device into a dev_warn().
This message is only displayed if a matching device was not found.
A warning is more appropriate here than info.
Consolidate the attach messages into one dev_info() output after
the successful 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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:37:25 +0000 (17:37 -0700)]
staging: comedi: ni_670x: remove n_ni_670x_boards macro
This macro is simply the ARRAY_SIZE() of the boardinfo. Just use
the ARRAY_SIZE and remove the macro.
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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:36:45 +0000 (17:36 -0700)]
staging: comedi: ni_670x: remove thisboard and devpriv macros
The 'thisboard' and 'devpriv' macros rely on a local variable having
a specific name and yield pointers derived from that local variable.
Replace the macros with local variables where used. Use the
comedi_board() helper to get the 'thisboard' 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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:36:09 +0000 (17:36 -0700)]
staging: comedi: ni_670x: remove forward declarations
Move the attach and detach functions to remove the need for the
forward declarations.
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>
H Hartley Sweeten [Sat, 30 Jun 2012 00:35:26 +0000 (17:35 -0700)]
staging: comedi: ni_670x: use module_comedi_pci_driver
Refactor the driver to use the module_comedi_pci_driver() helper.
This gets rid of some of the module boilerplate code.
For aesthetic reasons, rename the comedi_driver and pci_driver to
follow the convention of the other comedi pci 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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:08:39 +0000 (15:08 -0700)]
staging: comedi: adl_pci6208: use the driver_name for the resource name
Use the dev->driver->driver_name for the resource name passed to
pci_request_regions(), by way of comedi_pci_enable(), instead of
the open coded string "adl_pci6208".
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:07:56 +0000 (15:07 -0700)]
staging: comedi: adl_pci6208: cleanup pci6208_attach()
For aesthetic reasons, set the dev->board_name as soon as the
thisboard pointer is available.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:07:05 +0000 (15:07 -0700)]
staging: comedi: adl_pci6208: cleanup pci6208_ao_rinsn()
For aesthetic reasons, reorder the local variables and change
the return value to 'insn->n'.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:06:14 +0000 (15:06 -0700)]
staging: comedi: adl_pci6208: cleanup pci6208_ao_winsn()
Use the defines for the register map to make the code a bit
clearer. Shorten or rename some of the local variables for
the same reason.
Only the last value written to the DAC needs to be cached in
the ao_readback variable.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:04:47 +0000 (15:04 -0700)]
staging: comedi: adl_pci6208: fix the ao_readback variable size
The 'ao_readback' variable in the private data struct is used to
cache the last value written to the analog output DAC channels.
The PCI-6208 has 8 analog output channels but the variable only
allowed space to cache 2 values.
Since the PCI-6216 board could be supported by this driver and
it has 16 analog outputs, create a define for the maximum number
of channels and use that to set the size of 'ao_readback'.
For now, set the max to 8 to save space since the PCI-6216 is
not currently supported.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:04:04 +0000 (15:04 -0700)]
staging: comedi: adl_pci6208: remove unused variable in the private data
The 'data' variable in the private data struct is not 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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:03:31 +0000 (15:03 -0700)]
staging: comedi: adl_pci6208: remove some useless comments
Remove a number of useless comments that are cut-and-paste from
the skel 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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:02:53 +0000 (15:02 -0700)]
staging: comedi: adl_pci6208: remove the bogus pci devices
Remove the commented out pci device entries in the MODULE_DEVICE_TABLE
as well as the associated boardinfo, which is also commented out. Add
some whitespace to the boardinfo to improve readability.
This driver should also support the pci-6216 card which has an
additional 8 analog outputs (16 total). But the device id needs
to be determined.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:01:58 +0000 (15:01 -0700)]
staging: comedi: adl_pci6208: return '0' for successful attach
The comedi core expects a < 0 value during the attach to indicate
an error. The normal 'success' return for the kernel is '0' so use
that here.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:01:26 +0000 (15:01 -0700)]
staging: comedi: adl_pci6208: add whitespace to the subdev init
Add whitespace to the subdev initialization and remove the
unnecessary comments to improve readability.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:00:50 +0000 (15:00 -0700)]
staging: comedi: adl_pci6208: fix the digital i/o subdevice
The PCI-6208 board has 4 digital outputs and 4 digital inputs.
The support for the digital i/o subdevice was commented out and
the code was just cut-and-paste from the skel driver. Enable
the digital i/o subdevice by uncommenting the code and fixing
the insn_bits and insn_config 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>
H Hartley Sweeten [Wed, 27 Jun 2012 22:00:02 +0000 (15:00 -0700)]
staging: comedi: adl_pci6208: consolidate the attach messages
Consolidate the attach messages into one dev_info() output
at the end of a successful 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>
H Hartley Sweeten [Wed, 27 Jun 2012 21:59:19 +0000 (14:59 -0700)]
staging: comedi: adl_pci6208: pass on the error code from comedi_pci_enable
Return the actual error code from comedi_pci_enable instead of
assuming -EIO on failure. Also, shorten the local variable name 'retval'
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>
H Hartley Sweeten [Wed, 27 Jun 2012 21:58:03 +0000 (14:58 -0700)]
staging: comedi: adl_pci6208: remove pci6208_pci_setup()
Refactor pci6208_pci_setup() into the attach function. This
function simply enables the pci device and gets the PCI iobase
address used by the driver. There's no need for a separate
function to handle this.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 21:57:22 +0000 (14:57 -0700)]
staging: comedi: adl_pci6208: cleanup pci6208_pci_setup()
The "local configuration register" stuff is not required. The
io base/range are only queried for use in a kernel message
that it just added noise. Similar with the io range for the
actual io base used by the driver.
Remove both printk's and all the unnecessary code.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 21:56:43 +0000 (14:56 -0700)]
staging: comedi: adl_pci6208: document the register map of the device
Add defines for the register map of the device. These will be
used to clarify the code.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 21:56:03 +0000 (14:56 -0700)]
staging: comedi: adl_pci6208: remove the boardinfo 'ao_bits'
All the boards supported by this driver have 16-bit DACs. The
ao_bits variable in the boardinfo is commented out anyway.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 21:55:19 +0000 (14:55 -0700)]
staging: comedi: adl_pci6208: refactor pci6208_find_device()
Make the "find pci device" functions consistent in the comedi
drivers. Hopefully well be able to move it into the core...
Refactor the "find pci device" function to return a pointer to
the found struct pci_dev instead of an error code. Also, change
some of the tests to reduce the indent level of the code. Pass
the struct comedi_devconfig pointer to the function instead of
the bus/slot numbers.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 21:53:28 +0000 (14:53 -0700)]
staging: comedi: adl_pci6208: remove thisboard and devpriv macros
The 'thisboard' and 'devpriv' macros rely on a local variable having
a specific name and yield pointers derived from that local variable.
Replace the macros with local variables where used. Use the
comedi_board() helper to get the 'thisboard' 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>
H Hartley Sweeten [Wed, 27 Jun 2012 16:17:17 +0000 (09:17 -0700)]
staging: comedi: cb_pcidas: fix dac08_write_insn()
As pointed out by Ian Abbott, the comedi INSN_WRITE instructions
are meant to iterate over, and write, all the data[] passed from
the comedi core. Modify dac08_write_insn() to work as intended.
Since doc08_write_insn() now returns the proper response to the
core, make the dac08_write() helper return void.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Wed, 27 Jun 2012 01:12:15 +0000 (18:12 -0700)]
staging: comedi: cb_pcidas: cleanup dac08_write()
Reverse the logic of the test against the cached value so that
the function only has one exit point.
Make the logic of the dac write a bit clearer by create a local
variable for the address used in the outw() calls and masking the
value to write and setting the enable bits before doing the outw()
calls. Add a comment just to make sure it's clear.
Also, add a comment about the 'return 1;'. This should be
insn->n which is the number of data parameters used to do the
dac08_write_insn() but the insn is not a parameter to this
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:11:38 +0000 (18:11 -0700)]
staging: comedi: cb_pcidas: cleanup cb_pcidas_ai_rinsn()
Create local variables for the channel, range, and aref in order
to make the remaining code a bit cleaner.
Remove the extra space in all the comments.
Remove the 'static const int timeout' and just use the open
coded value in the 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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:10:59 +0000 (18:10 -0700)]
staging: comedi: cb_pcidas: cleanup cb_pcidas_ao_nofifo_winsn()
Create local variables for the channel and range in order to
cleanup to mask/set of the ao_control_bits.
Remove the extra space in all the comments.
Return the number of data parameters used (insn->n) to indicate
success instead of the open coded '1'.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:10:22 +0000 (18:10 -0700)]
staging: comedi: cb_pcidas: cleanup cb_pcidas_ao_fifo_winsn()
Create local variables for the channel and range in order to
cleanup to mask/set of the ao_control_bits.
Remove the extra space in all the comments.
Return the number of data parameters used (insn->n) to indicate
success instead of the open coded '1'.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:09:40 +0000 (18:09 -0700)]
staging: comedi: cb_pcidas: fix remaining checkpatch.pl issues
Fix the remaining three "WARNING: line over 80 characters" issues
reported by checkpatch.pl.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:09:01 +0000 (18:09 -0700)]
staging: comedi: cb_pcidas: add whitespace to all the #define's
Add whitespace to all the #define's in the driver in order to
improve the readability. Fix all the comments that are, or
already were, > 80 characters.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:08:17 +0000 (18:08 -0700)]
staging: comedi: cb_pcidas: change dac bit enums into defines
The 'bits' for the DAC_CSR register are currently defined as
enums. All the other registers use defines for the bit definitions.
Change the dac bit enums to defines to follow the other registers.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:07:32 +0000 (18:07 -0700)]
staging: comedi: cb_pcidas: fix comments in private data struct
A number of the comments in the private data struct definition
are causing checkpatch.pl to complain about "WARNING: line over
80 characters". Fix 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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:06:52 +0000 (18:06 -0700)]
staging: comedi: cb_pcidas: remove 'volatile' on private data variables
As indicated by checkpatch.pl, "WARNING: Use of volatile is usually
wrong: ...". The variables in the private data that are marked
volatile don't need to be. Remove the volatile.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Wed, 27 Jun 2012 01:06:08 +0000 (18:06 -0700)]
staging: comedi: cb_pcidas: fix comments in *_cmdtest functions
Remove some cut-and-paste comments from the skel driver in the
*_cmdtest functions. Shorten some others to fix the checkpatch.pl
complaints about WARNING: line over 80 characters.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:05:12 +0000 (18:05 -0700)]
staging: comedi: cb_pcidas: fix some > 80 char lines
Fix some of the comments that cause checkpatch.pl to complain
about WARNING: line over 80 characters.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:04:26 +0000 (18:04 -0700)]
staging: comedi: cb_pcidas: fix a space before tab issue
As reported by checkpatch.pl, spaces should not be used before
tabs.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:03:34 +0000 (18:03 -0700)]
staging: comedi: cb_pcidas: check for failure of subdev_8255_init
It's possible for subdev_8255_init() to fail due to its kzalloc().
Make sure to check for this failure and pass on the error code.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:02:40 +0000 (18:02 -0700)]
staging: comedi: cb_pcidas: use the driver_name for the resource name
Use the dev->driver->driver_name for the resource name passed
to pci_request_regions(), by way of comedi_pci_enable(), and
to request_irq() instead of the open coded "cb_pcidas".
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:01:51 +0000 (18:01 -0700)]
staging: comedi: cb_pcidas: move the "find pci" dev_printk messages
Move the dev_printk messages associated with the "find pci device"
from the *attach function into the *find_pci_device 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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:01:05 +0000 (18:01 -0700)]
staging: comedi: cb_pcidas: cleanup ai_config_insn()
Absorb the helper function ai_config_calibration_source() into
ai_config_insn() and remove the static const variable that
was in the helper function.
Return an error code (-EINVAL) when appropriate and the number
of data values used (insn->n) for success.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 01:00:19 +0000 (18:00 -0700)]
staging: comedi: cb_pcidas: cleanup the boardinfo 4
For aesthetic reasons, rename the ai_se_chans variable to
ai_nchan. It's a bit shorter and provides the necessary
information about the variable.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:59:17 +0000 (17:59 -0700)]
staging: comedi: cb_pcidas: cleanup the boardinfo 3
Remove the ai_diff_chans variable. This option is not used in
the driver. If it is used later, the value can be easily found
by using ai_se_chans/2.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:58:27 +0000 (17:58 -0700)]
staging: comedi: cb_pcidas: cleanup the boardinfo 2
Remove all the boardinfo values that are = 0. They will
default to that value.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:57:20 +0000 (17:57 -0700)]
staging: comedi: cb_pcidas: cleanup the boardinfo 1
For aesthetic reasons, add whitespace to the boardinfo to
improve readability.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:56:43 +0000 (17:56 -0700)]
staging: comedi: cb_pcidas: simplify the boardinfo
The boardinfo values 'has_ai_trig_gated' and 'has_ai_trig_invert'
are both only set for the "1602" versions of the boards supported
by this driver.
Simplify the boardinfo, and the code, by replacing these two
variables with one "is_1602" variable.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:56:04 +0000 (17:56 -0700)]
staging: comedi: cb_pcidas: remove unused io region size defines
The defines for the size of the io regions are not used in the
driver. Also, this information can be found using the pci helper
pci_resource_len(). Remove the defines.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:55:21 +0000 (17:55 -0700)]
staging: comedi: cb_pcidas: remove CB_PCIDAS_DEBUG define
This define enables some debug code that output a number
of dev_dbg() messages. These might be useful for development
but should not be in the final 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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:54:38 +0000 (17:54 -0700)]
staging: comedi: cb_pcidas: remove the PCI BAR index defines
The defines for the "indices of the base address regions" don't
add much to the readability of the code. They are only used in
the pci_resource_start() calls to get the base address for
the various io regions and the names of the variables provide
adequate documentation.
Remove the defines and just use the open-coded values for the
BARs. Also, remove the incomplete comment above the initialization
of the variables.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:53:55 +0000 (17:53 -0700)]
staging: comedi: cb_pcidas: remove some obvious comments in the attach
These comments are unnecessary.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:53:08 +0000 (17:53 -0700)]
staging: comedi: cb_pcidas: factor out the find pci device code
Factor the "find pci device" code out of the attach 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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:52:29 +0000 (17:52 -0700)]
staging: comedi: cb_pcidas: remove thisboard and devpriv macros
The 'thisboard' and 'devpriv' macros rely on a local variable having
a specific name and yield pointers derived from that local variable.
Replace the macros with local variables where used. use the
comedi_board() helper to get the 'thisboard' 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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:51:53 +0000 (17:51 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 9
Move the nvram_read function, and its helper, to remove the need
for the last of the forward declarations.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:51:14 +0000 (17:51 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 8
Move the trimpot_{7376,8402}_write functions to remove the need
for the forward declarations.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:50:36 +0000 (17:50 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 7
Move the caldac_8800_write function, and it's helper, to remove
the need for the forward declaration.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:49:58 +0000 (17:49 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 6
Move the cb_pcidas_load_counters function to remove the need for
the forward declaration.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:49:22 +0000 (17:49 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 5
Move the cb_pcida_ao_cancel function to remove the need for
the forward declaration.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:48:43 +0000 (17:48 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 4
Move the cb_pcida_cancel function to remove the need for
the forward declaration.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:48:05 +0000 (17:48 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 3
Move the handle_ao_interrupt function to remove the need for
the forward declaration.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:47:28 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 2
Move the cb_pcidas_ao_inttrig function to remove the need for
the forward declaration.
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>
H Hartley Sweeten [Wed, 27 Jun 2012 00:46:44 +0000 (17:46 -0700)]
staging: comedi: cb_pcidas: remove forward declarations 1
Move the attach/detach functions to remove the need for some
of the forward declarations.
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>
Javier Martinez Canillas [Tue, 26 Jun 2012 22:22:20 +0000 (00:22 +0200)]
staging: gdm72xx: fix an skb memory leak
The NLMSG_PUT() macro contains a hidden goto that jumps to the
nlmsg_failure label. Since the sk_buff was allocated before the macro,
jumping to the nlmsg_failure label leaks the memory allocated for it.
Calling kfree() before returning would fix it, but is better to avoid
using this error prone macro and use nlmsg_put() instead.
Also, use nlmsg_data() instead of NLMSG_DATA() to check type.
Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 17:08:52 +0000 (10:08 -0700)]
staging: comedi: cb_das16_cs: remove unneeded default case in analog in read
The default (return -EINVAL) case is not needed when working
out the correct value to set the analog input range. As pointed
out by Ian Abbott, the comedi core checks the range in
comedi_check_chanlist() before calling the insn_read() function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 17:07:23 +0000 (10:07 -0700)]
staging: comedi: cb_das16_cs: reword the comment about PCMCIA support
The original comment about the PCMCIA support code was wrong in that
it said this driver was for the "pcm-das08". When it was moved the
comment was reworded badly.
Fix the comment so it makes sense.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:23:44 +0000 (17:23 -0700)]
staging: comedi: cb_das16_cs: fix a multi-line comment
Fix a multi-line comment to follow the kernel CodingStyle.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:23:06 +0000 (17:23 -0700)]
staging: comedi: cb_das16_cs: remove some commented out debug
The das16cs_ao_winsn() function has a couple commented out
debug messages. Just remove them.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:22:18 +0000 (17:22 -0700)]
staging: comedi: cb_das16_cs: use the BIP_RANGE helper macro
The BIP_RANGE(a) macro can be used instead of the RANGE(a,b)
macro when -a == b. And it's a bit clearer that this is a bipolar
range.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:21:17 +0000 (17:21 -0700)]
staging: comedi: cb_das16_cs: remove unused variable in private data
The 'link' variable in the private data struct is not used by the
driver. Remove it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:18:43 +0000 (17:18 -0700)]
staging: comedi: cb_das16_cs: use #define'd io reg offsets
Instead of open coding the 'dev->iobase + n' for each io register
in the device, use the provided #define's for the offsets.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:17:52 +0000 (17:17 -0700)]
staging: comedi: cb_das16_cs: cleanup das16cs_ai_rinsn()
Cleanup to analog input read function.
1) Initialize the chan, range, and aref locale variables when
they are declared.
2) Remove need for the static local variable.
3) Remove the unnecessary cast of inw()'s return value.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:16:53 +0000 (17:16 -0700)]
staging: comedi: cb_das16_cs: add whitespace to the subdev init
Add some whitespace to the subdev initialization to improve
readability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:16:04 +0000 (17:16 -0700)]
staging: comedi: cb_das16_cs: return '0' for successful attach
The comedi core expects a < 0 value during the attach to indicate
an error. The normal 'success' return to the kernel is '0' so use
that here.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:15:21 +0000 (17:15 -0700)]
staging: comedi: cb_das16_cs: consolidate the attach messages
Consolidate all the attach messages into one dev_info() output
at the end of the successful attach.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:13:23 +0000 (17:13 -0700)]
staging: comedi: cb_das16_cs: cleanup the boardinfo
For aesthetic reasons, reorder the boardinfo to match the
MODULE_DEVICE_TABLE. Also reorder the data to match the
struct definition and add some whitespace to improve
readability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:12:41 +0000 (17:12 -0700)]
staging: comedi: cb_das16_cs: remove the debug output of the "fingerprint"
During the attach, all of the device i/o registers are read and
the data is output as a dev_dbg() "fingerprint". This just adds
a bunch of noise during the loading of the driver. Remove the
output.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:11:56 +0000 (17:11 -0700)]
staging: comedi: cb_das16_cs: probe for the device first
During the attach of the comedi_driver, the device type probe
can fail. We should do the probe before requesting the irq
for the driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:11:13 +0000 (17:11 -0700)]
staging: comedi: cb_das16_cs: remove unneeded include
This driver is not for a pci device. Remove the unneeded include
of the pci.h header.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:10:30 +0000 (17:10 -0700)]
staging: comedi: cb_das16_cs: fix analog output subdevice init
The analog output subdevice is only available on the -AO version
of the DAS16/16 device and the number of channels is provided in
the boardinfo. Make sure the subdevice is marked as unused for
devices that do not support the analog out.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Tue, 26 Jun 2012 00:00:19 +0000 (17:00 -0700)]
staging: comedi: cb_das16_cs: cleanup dio subdevice initialization
The digital i/o subdevice is always initialized due to the 'if (1)'.
Simplify the attach by removing the test.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Mon, 25 Jun 2012 23:59:26 +0000 (16:59 -0700)]
staging: comedi: cb_das16_cs: remove unused timer subdevice
The timer subdevice is never initialized due to the 'if (0)'. The
comedi callbacks also don't do anything and just return -EINVAL.
Remove the subdevice and associated code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Mon, 25 Jun 2012 23:58:34 +0000 (16:58 -0700)]
staging: comedi: cb_das16_cs: remove skel driver cut-and-paste comments
There are a number of comments in this driver that are cut-and-paste
from the skel driver. They are not needed in "real" drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Mon, 25 Jun 2012 23:57:36 +0000 (16:57 -0700)]
staging: comedi: cb_das16_cs: remove n_boards define
The 'n_boards' define is only used one place in the driver.
Just put the ARRAY_SIZE() where used and remove the define.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>