Commit Graph

111 Commits (93e562141ac58452bcea48718af92cc62a20669d)

Author SHA1 Message Date
H Hartley Sweeten a3ac95195b staging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check()
Allow comedi pcmcia drivers to use a custom conf_check() when calling
comedi_pcmcia_enable() to enable the pcmcia device. If a conf_check()
is not passed the internal comedi_pcmcia_conf_check() will be used.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 18:16:19 -08:00
H Hartley Sweeten 55ab4f641a staging: comedi: comedi_usb: allow comedi usb drivers to pass a 'context'
Allow the comedi usb drivers to pass a 'context' from their (*probe)
functions to the comedi core's comedi_usb_auto_config(). This 'context'
is then passed to comedi_auto_config() and then to the comedi_driver's
(*auto_attach).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten ddb2d0a018 staging: comedi: comedi_pcmcia: introduce comedi_pcmcia_{enable, disable}
Introduce some helper functions to enable/disable the PCMCIA device.
This will allow removing some of the boilerplate code in the comedi
PCMCIA 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>
2013-02-04 14:47:18 -08:00
H Hartley Sweeten 7f70410fe0 pci_ids.h: add common pci vendor ids from comedi subsystem
There are a number of pci vendor ids that are used in multiple
drivers in the comedi subsystem. Move these ids to pci_ids.h.

This also fixes some build warnings reported by the kbuild test
robot about PCI_VENDOR_ID_AMPLICON being undeclared.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:49:16 -08:00
Ian Abbott da71751177 staging: comedi: export comedi_set_hw_dev()
Chnage the inline `comedi_set_hw_dev()` to an exported function and
change it's return type from `void` to `int` so we can impose some
restrictions (in a later patch) and return an error if necessary.

Only a few comedi drivers call this, although they don't need to if the
hardware device has been attached automatically via
`comedi_auto_config()` and the comedi driver's `auto_attach()` method.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:44:19 -08:00
Ian Abbott e9ab1c2f7e staging: comedi: move comedi_alloc_subdevice_minor declarations
Move the declarations of `comedi_alloc_subdevice_minor()` and
`comedi_free_subdevice_minor()` from "comedidev.h" to
"comedi_internal.h" since they are only of interest to the comedi core,
and are not exported to the low-level comedi drivers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:43:27 -08:00
H Hartley Sweeten 085494ac20 staging: comedi: don't expose comedi_proc_{init,cleanup}
These functions are only used by the comedi core. Move the
prototypes to comedi_internal.h so they are not exposed to
the comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 39bd5e59b1 staging: comedi: don't expose comedi_device_{attach,detach}
These functions are only used by the comedi core. Move the
prototypes to comedi_internal.h so they are not exposed to
the comedi drivers.

Tidy up comedi_internal.h a bit so that all the internal stuff
in drivers.c is grouped.

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-01-31 10:40:41 +01:00
H Hartley Sweeten 1ae6b20b88 staging: comedi: tidy up the general purpose driver functions
Group all the general comedi driver register/config/attach
prototypes into one place in comedidev.h.

Reorder the functions in drivers.c a bit so they are in a more
logical usage order (bottom to top).

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-01-31 10:40:41 +01:00
H Hartley Sweeten 1f021e1f3b staging: comedi: allow pcmcia drivers to auto attach
Introduce some helper functions to allow converting the comedi
pcmcia drivers to the comedi auto_attach mechanism.

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-01-31 10:40:41 +01:00
H Hartley Sweeten 309231d7a6 staging: comedi: conditionally build in PCMCIA driver support
Separate the comedi_pcmcia_* functions out of drivers.c into a new
source file, comedi_pcmcia.c. This allows conditionally building
support for comedi pcmcia drivers into the comedi core without the
need for the #if'defery. Fix the Kconfig and Makefile appropriately.

Group all the comedi_pcmcia_* prototypes into one place in comedidev.h.
Protect these prototypes with an #ifdef so that building a comedi
pcmcia driver without PCMCIA support will cause a build error. This
will normally not happen as long as the comedi pcmcia driver is placed
in the proper group in the Kconfig.

Remove the #include <pcmcia/*.h> from drivers.c. These includes are only
needed by the comedi pcmcia driver support code and the pcmcia drivers.
The include should occur in those files.

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-01-31 10:38:10 +01:00
H Hartley Sweeten 33782dd5ed staging: comedi: conditionally build in PCI driver support
Separate the comedi_pci_* functions out of drivers.c into a new
source file, comedi_pci.c. This allows conditionally building
support for comedi PCI drivers into the comedi core. Fix the
Kconfig and Makefile appropriately.

Group all the comedi_pci_* prototypes and related defines into one
place in comedidev.h. Protect these prototypes with an #ifdef and
provide some dummy functions so that the mixed ISA/PCI comedi
drivers will still build correctly.

Remove the #include <linux/pci.h> from comedidev.h and drivers.c. This
include is only needed by the comedi PCI driver support code and the
PCI drivers. The include should occur in those files.

Also, remove the #include <linux/pci.h> from a couple non-PCI drivers
since it's not 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-01-31 10:38:10 +01:00
H Hartley Sweeten abac8b54a3 staging: comedi: conditionally build in USB driver support
Separate the comedi_usb_* functions out of drivers.c into a new
source file, comedi_usb.c. This allows conditionally building
support for comedi USB drivers into the comedi core without the
need for the #if'defery. Fix the Kconfig and Makefile appropriately.
For aesthetic reasons, add some whitespace to the Makefile to keep
everything lined up.

Group all the comedi_usb_* prototypes into one place in comedidev.h.
Protect these prototypes with an #ifdef so that building a comedi
usb driver without USB support will cause a build error. This will
normally not happen as long as the comedi USB driver is placed in
the proper group in the Kconfig.

Remove the #include<linux/usb.h> from comedidev.h and drivers.c. This
include is only needed by the comedi USB driver support code and the
USB drivers. The include should occur in those files.

Removing the include of usb.h exposed a couple drivers that need
<linux/interrupt.h> and <linux/sched.h>. Add the missing includes.

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-01-31 10:35:48 +01:00
Ian Abbott bc3954b814 staging: comedi: simplify comedi_set_hw_dev()
Since `get_device()` and `put_device()` can take a NULL device
parameter, `comedi_set_hw_dev()` can be simplified to always call
`get_device()` for the new, possibly NULL hardware device, and
`put_device()` for the old, possibly NULL hardware device.  As long as
we do it in that order, there shouldn't be any problem with
`kref_release()` getting called unexpectedly when the new hardware
device is the old hardware device.

Simplify `comedi_set_hw_dev()` and update the comment because the
function is used for additional purposes since the old comment was
written.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:11:41 -05:00
Peter Huewe c2f90a20c9 staging/comedi: Move comedi_pci_auto_unconfig to drivers.c
Since comedi_pci_auto_unconfig cannot be inlined anymore after
 staging/comedi: Use comedi_pci_auto_unconfig directly for
 pci_driver.remove
is applied, it makes sense to move it drivers.c

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25 12:04:36 -08:00
Peter Huewe d607ffac4c staging/comedi: Add macro for registering a comedi PCMCIA driver
This patch introduces a new macro 'module_comedi_pcmcia_driver'
for comedi PCMCIA drivers which do not do anything special in module
init/exit. This eliminates a lot of boilerplate.

Adapted from 'module_comedi_pci_driver'

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 16:59:25 -08:00
H Hartley Sweeten 8ae560a14a staging: comedi: comedi_buf: reorder exported function prototypes
For aesthetic reasons, reorder the prototypes for the exported
comedi_buf_* functions in comedidev.h to follow the function
declarations in comedi_buf.c.

Also, change a couple of the return values from 'unsigned' to
'unsigned int' to match the value actually returned.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 16:54:00 -08:00
H Hartley Sweeten 8bd650f91b staging: comedi: comedi_buf: don't expose comedi_buf_write_n_allocated()
This helper function is only called by the comedi core in comedi_buf.c
and comedi_fops.c. For aesthetic reasons, move it to comedi_buf.c and
remove the inline. Move the prototype from comedidev.h to comedi_internal.h
so it's not exposed outside the comedi core.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 16:53:59 -08:00
H Hartley Sweeten 5b2b64b751 staging: comedi: comedi_buf: don't expose comedi_buf_read_n_allocated()
This helper function is only called in comedi_buf.c. Move it there and
make it static so it's not exposed globally.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 16:53:59 -08:00
H Hartley Sweeten 47181eab71 staging: comedi: comedi_buf: remove comedi_buf_write_alloc_strict
This function is only called by comedi_buf_put(). Remove it and just
call __comedi_buf_write_alloc() directly with the strict flag set.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 16:53:58 -08:00
H Hartley Sweeten f8f76e909b staging: comedi: comedi_buf: factor out common comedi_buf_write_alloc_* code
The only difference between comedi_buf_write_alloc() and the *_strict()
version is that the *_strict() one will only allocate the chunk if it
can completely fulfill the request.

Factor out the common code and add a flag parameter to indicate the 'strict'
usage. Change the exported functions so they are just wrappers around the
common function.

Cleanup the common function a bit and use the comedi_buf_write_n_available()
helper to determine the number of bytes available.

comedi_buf_write_n_available() is not used outside this module so make it
static. Since the only caller is __comedi_buf_write_alloc(), which will
always have a valid async pointer and already has a memory barrier, we
can remove the unnecessary (async == NULL) test as well as the smp_mb().
Also, the rounding of the sample size can be removed since the caller
does not need it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 16:53:58 -08:00
H Hartley Sweeten d18431325b staging: comedi: deprecate loading firmware with comedi_config
All the comedi drivers have been converted to use the request_firmware()
hotplug interface. The COMEDI_DEVCONFIG ioctl support for passing the
firmware blob as 'aux_data' is no longer required.

Remove the feature and give the user a dev_warn message if it is
attempted.

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-01-17 16:51:46 -08:00
Lijo Antony 21f181f16c Staging: comedi: comedidev.h: fixed a camel case
Fixed a camel case issue.

Signed-off-by: Lijo Antony <lijo.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 14:34:49 -08:00
H Hartley Sweeten 90a35c15c5 staging: comedi: store the 'index' for each subdevice
Store the 'index' for each comedi_subdevice when they are initially
allocated by comedi_alloc_subdevice(). This allows removing the
pointer math in comedi_fops.c which is used to figure out the
index that user space uses to access the individual subdevices.

Fix the ni_mio_common driver so it also uses the 'index' instead
of doing the pointer math.

Also, remove a couple unused macros in the pcmda12, pcmmio, and
pcmuio drivers which also do the pointer math to figure out the
index.

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-01-07 14:28:19 -08:00
H Hartley Sweeten ade1764ff5 staging: comedi: comedi_fops: don't export comedi_get_subdevice_runflags()
The subdevice runflags are protected with a spin_lock. Only the comedi
core should be accessing them directly.

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-01-07 14:25:49 -08:00
H Hartley Sweeten e0dac318ee staging: comedi: comedi_fops: introduce comedi_is_subdevice_running()
Introduce a helper function that checks the subdevice runflags to
see if the subdevice is running a command.

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-01-07 14:25:48 -08:00
H Hartley Sweeten e79c8d2100 staging: comedi: don't expose struct comedi_device_file_info
This structure is only used in comedi_fops.c as part of handling
the file operations and sysfs files. Remove it's defenition from
comedidev.h so it's not exposed to the comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 14:25:47 -08:00
H Hartley Sweeten 87b1ad7a80 staging: comedi: comedi_fops: don't export comedi_get_device_file_info()
This function is now only used in comedi_fops.c and does not need
to be exported.

Make it static and move it to avoid 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>
2013-01-07 14:25:46 -08:00
H Hartley Sweeten 85104e9b40 staging: comedi: comedi_fops: introduce comedi_dev_from_minor()
A number of functions have to call comedi_get_device_file_info()
to get the comedi_device_file_info pointer for a given minor. That
pointer is only used to get the actual comedi_device pointer for
the minor.

Introduce a new helper function, comedi_dev_from_minor(), to simplify
this operation. This will also allow us to make the comedi_device_file_info
struct 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-01-07 14:25:46 -08:00
H Hartley Sweeten 43bd33f224 staging: comedi: don't expose comedi_get_{read, write}_subdevice
These two inline helper function in comedidev.h are only used in
comedi_fops.c. They return information that should only be used
by the comedi core.

Move both functions to comedi_fops.c so they aren't exposed to
the comedi drivers. Also, remove the inline tag and let the
compiler figure it out.

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-01-07 14:25:46 -08:00
Ian Abbott 581a7ddec1 staging: comedi: use inlines for PCI/USB auto config
Apart from the somewhat unnecessary `BUG_ON()` calls,
`comedi_pci_auto_config()` and `comedi_usb_auto_config()` are just
one-line wrappers around `comedi_auto_config()`, and
`comedi_pci_auto_unconfig()` and `comedi_usb_auto_unconfig()` are just
one-line wrappers around `comedi_auto_unconfig()`.  Convert them to
inline functions and remove the `BUG_ON()` calls.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 16:25:48 -08:00
Ian Abbott ddbd029903 staging: comedi: remove attach_pci and attach_usb handlers
No comedi drivers set the `attach_pci()` or `attach_usb()` handlers in
their `struct comedi_driver` any longer as they have all been replaced
with an `auto_attach()` handler.  Also, no code calls the `attach_pci()`
or `attach_usb()` handlers any longer.  Remove them from `struct
comedi_driver`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 16:25:48 -08:00
Ian Abbott 4dba6c02cd staging: comedi: comedidev.h: make comedi_board() parameter const
The inline function `comedi_board(dev)` merely returns `dev->board_ptr`.
It does not modify any members of `*dev` so make its parameter a const
pointer.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-06 09:28:58 +01:00
Ian Abbott 0a577b823d staging: comedi: add comedi to usb interface helper
Add inline helper function `comedi_to_usb_interface()` to get the
pointer to `struct usb_interface` associated with the comedi device.
This pointer is set by the call to `comedi_usb_auto_config()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-29 15:02:08 -07:00
Ian Abbott 8ed705aff0 staging: comedi: add generic auto-config functions
Add (and export) generic auto-config function `comedi_auto_config()` to
allow hardware devices on arbitrary bus types (e.g. platform devices,
spi devices, etc.) to be auto-configured as comedi devices.  This uses a
new `auto_attach()` hook in the `struct comedi_driver`.  This new hook
will eventually replace the bus-specific `attach_pci()` and
`attach_usb()` hooks in the low-level comedi drivers.

When the `auto_attach()` hook is called in the low-level driver, the
`hw_dev` member of the `struct comedi_device` will have already been set
to the hardware device passed to `comedi_auto_config()`.  The low-level
driver can convert this to some bus-device wrapper structure pointer,
possibly with the help of the `context` parameter that is passed
unchanged from the `comedi_auto_config()` call.

Also export the existing `comedi_auto_unconfig()` function as the
matching call to `comedi_auto_config()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-29 15:02:08 -07:00
H Hartley Sweeten 2847ff5d1b staging: comedi: comedidev.h: add PCI_VENDOR_ID_AMPLICON
Add a define for the Amplicon Liveline Limited PCI vendor id.
Remove the duplicates in the 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>
2012-10-24 19:41:05 -07:00
H Hartley Sweeten 268533124d staging: comedi: comedidev.h: add PCI_VENDOR_ID_AMCC
Add a define for the Applied Micro Circuits Corp. PCI vendor id.
Remove the duplicates in the 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>
2012-10-24 19:39:19 -07:00
H Hartley Sweeten 50d3c3f591 staging: comedi: comedidev.h: add PCI_VENDOR_ID_RTD
Add a define for the RTD Embedded Technologies, Inc. PCI vendor id.
Remove the duplicates in the 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>
2012-10-24 19:39:19 -07:00
H Hartley Sweeten 34f8d2089d staging: comedi: comedidev.h: add PCI_VENDOR_ID_IOTECH
Add a define for the Iotech Inc. PCI vendor id. Remove the duplicates
in the 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>
2012-10-24 19:39:19 -07:00
H Hartley Sweeten 0d374622a8 staging: comedi: comedidev.h: add PCI_VENDOR_ID_KOLTER
Add a define for the Kolter Electronic PCI vendor id. Remove the
duplicates in the 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>
2012-10-24 19:39:19 -07:00
H Hartley Sweeten f656ef5b6c staging: comedi: comedidev.h: add PCI_VENDOR_ID_DT
Add a define for the Data Translation, Inc. PCI vendor id. Remove
the duplicates in the 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>
2012-10-24 19:38:17 -07:00
H Hartley Sweeten b77d93a030 staging: comedi: comedidev.h: add PCI_VENDOR_ID_MEILHAUS
Add a define for the Meilhaus Electronic GmbH Germany PCI vendor id.
Remove the duplicates in the 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>
2012-10-24 19:38:16 -07:00
H Hartley Sweeten 12f07ba56b staging: comedi: comedidev.h: add PCI_VENDOR_ID_ADVANTECH
Add a define for the Advantech Co., Ltd. PCI vendor id. Remove the
duplicates in the 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>
2012-10-24 19:38:16 -07:00
H Hartley Sweeten cb3e9d8694 staging: comedi: comedidev.h: add PCI_VENDOR_ID_CB
Add a define for the ComputerBoards/Measurement Computing PCI
vendor id. Remove the duplicates in the 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>
2012-10-24 19:35:48 -07:00
H Hartley Sweeten c34fa261b0 staging: comedi: remove inline alloc_private()
This inline function has a very generic name and it's only a
wrapper around a simple kzalloc(). Since the inline function
does not save any lines-of-code, instead of renaming it just
remove it and do the kzalloc() directly.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23 20:28:19 -07:00
Ian Abbott 0a7717dfe0 staging: comedi: avoid a put_device(), get_device() sequence
In `comedi_set_hw_dev()`, if there is no change to `dev->hw_dev` (and it
is not `NULL`), don't bother putting and getting the device.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 12:43:37 -07:00
Ian Abbott 4f870fe626 staging: comedi: replace printk calls in comedi core
Replace the printk() calls in the comedi core module with something more
suitable, such as dev_...() or pr_...().  Remove the ones that report a
failure to increment a module count (try_module_get() failure).  Change
the printk() call in the DPRINTK() macro to pr_debug().

TODO: Most of the DPRINTK() calls need to be replaced with something
else.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-16 11:35:45 -07:00
H Hartley Sweeten ddb01367b8 staging: comedi: comedidev.h: introduce comedi_to_pci_dev() helper
Introduce a wrapper for to_pci_dev() to allow the comedi_pci_drivers
to store the pci_dev pointer in the comedi_device hw_dev variable and
retrieve it easily.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbot <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-19 16:19:39 -07:00
H Hartley Sweeten 928ae0956d staging: comedi: remove CONFIG_COMEDI_PCI define
CONFIG_COMEDI_PCI is not actually a Kconfig option. It is defined
in the comedidev.h header based on another Kconfig option being
enabled.

It is only referenced in the skel driver to conditionally compile
in the PCI support code. Use the CONFIG_COMEDI_PCI_DRIVERS Kconfig
option instead 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>
2012-06-20 13:00:42 -07:00
H Hartley Sweeten d4d3c4e676 staging: comedi: remove unused CONFIG_COMEDI_PCMCIA define
CONFIG_COMEDI_PCMCIA is not actually a Kconfig option. It is
defined in the comedidev.h header based on another Kconfig
option being enbled.

Just remove it since the define is not used by any of the comedi
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>
2012-06-20 13:00:42 -07:00