Peter Huewe [Mon, 21 Jan 2013 20:51:57 +0000 (21:51 +0100)]
staging/comedi: remove workaround for !pci_driver.name
All pci drivers in drivers/ have the pci_driver.name field set, so we
can remove this workaround and the accompanying todo.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peter Huewe [Mon, 21 Jan 2013 21:23:46 +0000 (22:23 +0100)]
staging/comedi: Add pci_driver.name to skel driver
This patch adds the comedi_driver.name to pci_driver.name
to the skel driver, so we can remove the workaround in drivers.c
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peter Huewe [Mon, 21 Jan 2013 20:29:43 +0000 (21:29 +0100)]
staging/comedi: Use bool initializations
Found with coccicheck.
The semantic patch that makes this output is available
in scripts/coccinelle/misc/boolinit.cocci.
More information about semantic patching is available at
http://coccinelle.lip6.fr/
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Mon, 21 Jan 2013 22:19:45 +0000 (14:19 -0800)]
Staging: comedi: enable it to build on all arches
Hopefully all of the arch-specific problems are now resolved, so let's
let this subsystem be enabled on all arches. If there are problems
found, we will fix them up.
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 21 Jan 2013 17:21:23 +0000 (17:21 +0000)]
staging: comedi: Allow comedi on ARM
Bernd Porr reports success getting comedi to work on ARM. He writes:
"""
comedi works nicely on the Raspberry PI. I've compiled the rpi kernel
with comedi enabled and it works with the USBDUX-sigma (need to test the
other boards). With comedirecord running I can plot one channel at 1kHz
without buffer overflow (resulting to 70% load).
So, I guess we just need to add "ARM" to Kconfig in the comedi subdir?
depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86 || ARM
I'm running just now 3.2.27 but also the development kernel compiles
with ARM enabled (haven't tested yet).
/Bernd
"""
Enable the COMEDI config option to be selected for ARM.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Julia Lawall [Mon, 21 Jan 2013 13:02:47 +0000 (14:02 +0100)]
staging: omap-thermal/omap-bandgap.c: adjust duplicate test
Delete successive tests to the same location. There was a previous test on
ret and it has not been updated since then.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@s exists@
local idexpression y;
expression x,e;
@@
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
{ ... when forall
return ...; }
... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
{ ... when forall
return ...; }
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chen Gang [Mon, 21 Jan 2013 09:36:33 +0000 (17:36 +0800)]
staging: tidspbridge/pmgr: another using strlcpy instead of strncpy
The fields must be null-terminated,
or next strstr in dcd_get_objects, will cause issue
additoinal info:
nldr_create may call cod_get_base_name, let sz_zl_file to get name (sz_name)
and then call dcd_get_objects, passing sz_zl_file as a name string.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chen Gang [Mon, 21 Jan 2013 09:35:00 +0000 (17:35 +0800)]
staging: tidspbridge/pmgr: use strlcpy instead of strncpy
The fields must be null-terminated,
or next strcpy in dbll_find_dsp_symbol, will cause issue
additoinal info:
dbll_find_dsp_symbol call find_symbol_callback to get name.
and then call strcpy to copy the name to upper caller.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chen Gang [Mon, 21 Jan 2013 09:33:26 +0000 (17:33 +0800)]
staging: tidspbridge/pmgr: additional checking after return from strlen_user
strlen_user will return the length including final NUL.
and will return 0 if failed (for example: if user string not NUL terminated)
so need check whether it is an invalid parameter.
addtional info:
can reference the comments of strlen_user in lib/strnlen_user.c
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Mon, 21 Jan 2013 00:57:49 +0000 (02:57 +0200)]
staging: xgifb: delete pVBInfo->BaseAddr
Delete redundant field.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Mon, 21 Jan 2013 00:57:48 +0000 (02:57 +0200)]
staging: xgifb: do not use pVBInfo->BaseAddr
Use pre-calculated register addresses instead of pVBInfo->BaseAddr.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Mon, 21 Jan 2013 00:57:47 +0000 (02:57 +0200)]
staging: xgifb: use XGIRegInit()
Avoid copy-paste and use XGIRegInit() to initialize registers addresses.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jake Champlin [Sat, 19 Jan 2013 02:44:07 +0000 (21:44 -0500)]
Staging: Comedi: daqboard2000: Fixed Coding Style Issue
Fixed Coding Style Warning
Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jake Champlin [Sat, 19 Jan 2013 06:03:32 +0000 (01:03 -0500)]
Staging: Comedi: pcl818: Fixed Coding Style Issues
Fixed single line if statement brace issues as well as pointer errors from
checkpatch.pl
Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Hajnoczi [Sat, 19 Jan 2013 10:18:44 +0000 (11:18 +0100)]
staging: line6: clean up line6_variax_process_message()
Previous versions of the line6 driver snooped MIDI traffic in order to
make device state accessible via sysfs attributes. This involved a lot
of logic in line6_variax_process_message() that has since been removed.
Drop unused conditionals in line6_variax_process_message().
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Hajnoczi [Sat, 19 Jan 2013 10:18:43 +0000 (11:18 +0100)]
staging: line6: clean up line6_pod_process_message()
Previous versions of the line6 driver snooped MIDI traffic in order to
make device state accessible via sysfs attributes. This involved a lot
of logic in line6_pod_process_message() that has since been removed.
Drop unused conditionals in line6_pod_process_message() and reduce the
levels of indentation. Only two MIDI messages are still tracked: the
POD version message on startup and monitor level changes originating
from the device.
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Hajnoczi [Sat, 19 Jan 2013 08:59:00 +0000 (09:59 +0100)]
staging: line6: drop CONFIG_LINE6_USB_DUMP_PCM
The CONFIG_LINE6_USB_DUMP_PCM config option prints a hexdump of PCM
audio data as URBs are sent and received. The usbmon feature should be
used instead of manually dumping PCM URBs. There are a few advantages
to using usbmon:
* Can be turned on/off at runtime
* Provides full USB-level traffic
* tcpdump and wireshark support for powerful analysis
* No driver-specific code is required
This is the last user of line6_write_hexdump() so we drop it too.
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sebastian Wankerl [Sun, 20 Jan 2013 15:30:54 +0000 (16:30 +0100)]
wlan-ng/prism2mgmt.c: formated too long lines
Formated pr_debug() calls
Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de>
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sebastian Wankerl [Sun, 20 Jan 2013 15:24:45 +0000 (16:24 +0100)]
wlan-ng/prism2mgmt.c: added parantheses to macro
Enclose the macro into braces so that it can be closed by a semicolon
Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de>
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jake Champlin [Sat, 19 Jan 2013 01:23:36 +0000 (20:23 -0500)]
Staging: Comedi: amplc_dio200: Fixed bracing issue
Fixed coding style error
Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Magenheimer [Fri, 18 Jan 2013 21:24:27 +0000 (13:24 -0800)]
staging: zcache: fix uninitialized variable compile warning
[V2: no code changes, patchset now generated via git format-patch -M]
Fix unitialized variable in zcache which generates warning during build
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Magenheimer [Fri, 18 Jan 2013 21:24:26 +0000 (13:24 -0800)]
staging: zcache: re-enable config/build of zcache after renaming
In staging, re-enable config/build of zcache after ramster->zcache renaming.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Magenheimer [Fri, 18 Jan 2013 21:24:25 +0000 (13:24 -0800)]
staging: zcache: adjustments to config/build files due to renaming
[V2: no code changes, patchset now generated via git format-patch -M]
In staging/zcache, adjust config/build due to ramster->zcache renaming
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Magenheimer [Fri, 18 Jan 2013 21:24:24 +0000 (13:24 -0800)]
staging: zcache: rename ramster to zcache
[V2: no code changes, patchset now generated via git format-patch -M]
In staging, rename ramster to zcache
The original zcache in staging was a "demo" version, and this new zcache
is a significant rewrite. While certain disagreements were being resolved,
both "old zcache" and "new zcache" needed to reside in the staging tree
simultaneously. In order to minimize code change and churn, the newer
version of zcache was temporarily merged into the "ramster" staging driver
which, prior to that, had at one time heavily leveraged the older version
of zcache. So, recently, "new zcache" resided in the ramster directory.
Got that? No? Sorry, temporary political compromises are rarely pretty.
The older version of zcache is no longer being maintained and has now
been removed from the staging tree. So now the newer version of zcache
can rightfully reclaim sole possession of the name "zcache".
FYI, this [PATCH 2/5] is simply a "git mv" generated by "git format-patch -M".
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Magenheimer [Fri, 18 Jan 2013 21:24:23 +0000 (13:24 -0800)]
staging: ramster: disable build in anticipation of renaming
[V2: no code changes, patchset now generated via git format-patch -M]
In staging, disable ramster build in anticipation of renaming to zcache
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Fri, 18 Jan 2013 17:48:25 +0000 (10:48 -0700)]
staging: comedi: addi_apci_16xx: cleanup addi_find_boardinfo()
This function was originally in the addi-data "common" code and
required using pointer math to access the boardinfo data using
the void * 'dev->driver->board_name'. Now that the function is
local to this driver we can access the boardinfo directly and
remove the pointer math.
Rename the function so it has namespace associated with this
driver.
Also, for aesthetic reasons, globally rename the local variable used
for the boardinfo pointer from 'this_board' to 'board',
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, 18 Jan 2013 17:47:48 +0000 (10:47 -0700)]
staging: comedi: addi_apci_16xx: redefine the boardinfo
Currently this driver uses the struct addi_board from the addi-data
"common" code to define the boardinfo. This struct contains a lot
of information that is not used in this driver.
Introduce a private struct in the driver that just contains the
needed information.
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, 18 Jan 2013 17:47:19 +0000 (10:47 -0700)]
staging: comedi: addi_apci_16xx: remove need for comedi_board()
Currently this driver uses the total number of channels, stored
in the boardinfo, in a number of the subdevice insn_* functions.
This information is already available in the subdevice as 's->n_chan'.
Use that instead of needing to get the board pointer first.
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, 18 Jan 2013 17:46:49 +0000 (10:46 -0700)]
staging: comedi: addi_apci_16xx: cleanup subdevice initialization
The comedi subdevice in this driver is a simple digital i/o
device.
Currently, the code abuses the comedi API by redefining the
COMEDI_SUBD_SERIAL type as COMEDI_SUBD_TTLIO and using that
for the 's->type'. Remove the defines and use the proper type,
COMEDI_SUBD_DIO.
The current code also sets the subdev_flags SDF_GROUND and SDF_COMMON
for the subdevice. These flags really only have meaning for analog
subdevices. Remove them.
All the boards supported by this driver use the same functions for
the subdevice 'insn_*' operations. Remove this information from
the boardinfo and set the s->insn_* operations directly in the init.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Fri, 18 Jan 2013 17:46:17 +0000 (10:46 -0700)]
staging: comedi: addi_apci_16xx: only allocate needed subdevices
The addi-data "common" code always allocated 7 subdevices. This
driver only uses 1. Change the allocation and remove the unused
subdevices.
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, 18 Jan 2013 17:45:55 +0000 (10:45 -0700)]
staging: comedi: addi_apci_16xx: remove devpriv->s_EeParameters usage
This information is not used in the driver. 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 [Fri, 18 Jan 2013 17:45:34 +0000 (10:45 -0700)]
staging: comedi: addi_apci_16xx: remove devpriv->iobase usage
The iobase address stored in devpriv->iobase is also stored in
dev->iobase. Use that instead.
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, 18 Jan 2013 17:45:07 +0000 (10:45 -0700)]
staging: comedi: addi_apci_16xx: remove unnecessary comments
A lot of the comments in hwdrv_apci16xx.c have whitespace damage and
are simply unnecessary. Just remove them to make the code a bit more
readable.
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, 18 Jan 2013 17:44:11 +0000 (10:44 -0700)]
staging: comedi: addi_apci_16xx: simplify PCI bar reading
The boards supported by this driver do not have an eeprom. Knowing
this information allows simplifying the code that reads the PCI
bars to get the iobase addresses.
The only 'iobase' actually used by this driver is found in PCI
bar 0. Don't bother reading the other PCI bars.
Also, since 'dw_AiBase' is not ioremap'ed we can remove the check
and iounmap 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>
H Hartley Sweeten [Fri, 18 Jan 2013 17:43:48 +0000 (10:43 -0700)]
staging: comedi: addi_apci_16xx: remove interrupt support code
The boards supported by this driver do not have any interrupt
capable devices. Remove the unused interrupt support 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 [Fri, 18 Jan 2013 17:43:23 +0000 (10:43 -0700)]
staging: comedi: addi_apci_16xx: remove i_APCI16XX_Reset()
The 'reset' function for this driver doesn't do anything. 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 [Fri, 18 Jan 2013 17:43:00 +0000 (10:43 -0700)]
staging: comedi: addi_apci_16xx: remove eeprom support code
Reading the eeprom on the boards supported by this driver is not
necessary. All the information required is in the boardinfo.
Remove the eeprom support code since it's not really interesting
or useful.
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, 18 Jan 2013 17:42:35 +0000 (10:42 -0700)]
staging: comedi: addi_apci_16xx: board does not have a timer
The boards supported by this driver do not have a timer subdevice.
Remove the subdevice init for 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 [Fri, 18 Jan 2013 17:42:13 +0000 (10:42 -0700)]
staging: comedi: addi_apci_16xx: board does not have digital outputs
The boards supported by this driver do not have digital outputs.
Remove the subdevice init for 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>
H Hartley Sweeten [Fri, 18 Jan 2013 17:41:52 +0000 (10:41 -0700)]
staging: comedi: addi_apci_16xx: board does not have digital inputs
The boards supported by this driver do not have digital inputs.
Remove the subdevice init for 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>
H Hartley Sweeten [Fri, 18 Jan 2013 17:41:31 +0000 (10:41 -0700)]
staging: comedi: addi_apci_16xx: board does not have analog outputs
The boards supported by this driver do not have analog outputs.
Remove the subdevice init for 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>
H Hartley Sweeten [Fri, 18 Jan 2013 17:41:07 +0000 (10:41 -0700)]
staging: comedi: addi_apci_16xx: board does not have analog inputs
The boards supported by this driver do not have analog inputs.
Remove the subdevice init for 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>
H Hartley Sweeten [Fri, 18 Jan 2013 17:40:31 +0000 (10:40 -0700)]
staging: comedi: addi_apci_16xx: separate from addi_common.c
This driver is for two simple ttl digital output boards. One with
48 channels the other with 96. Using the addi-data "common" code
introduces a lot of bloat.
Copy the code in addi_common.c to this driver and remove the #include
that caused addi_common.c to be compiled with this driver. This will
allow removing the bloat.
Rename the auto_attach and detach functions so they have namespace
associated with this 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, 18 Jan 2013 00:41:25 +0000 (17:41 -0700)]
staging: comedi: addi_apci_2032: use addi_watchdog module
Use the addi_watchdog module to provide support for the watchdog
subdevice.
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, 18 Jan 2013 00:41:01 +0000 (17:41 -0700)]
staging: comedi: introduce addi_watchdog driver
Many of the ADDI-DATA drivers have a "watchdog" subdevice that can
be used to monitor digital output activity. All the digital outputs
are released (set to 0) if the digital outputs are not accessed, or
the watchdog it not pinged, before the timeout of the watchdog
occurs. The only difference in the drivers for the watchdog subdevice
is the base address used to talk to the watchdog registers.
Instead of duplicating the code needed to support this watchdog,
introduce a helper module, similar to the 8255 module. This module
will be select'ed by the drivers that can use 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 [Fri, 18 Jan 2013 00:40:31 +0000 (17:40 -0700)]
staging: comedi: addi_apci_2200: cleanup digital output subdevice
The board supported by this driver always has a digital output subdevice.
Remove the boardinfo for it and just open-code the relevant data in the
subdevice init.
Remove the SDF_GROUND and SDF_COMMON from the subdevice 'subdev_flags'.
These flags only have meaning for analog input/output subdevices. Also,
remove the SDF_READABLE flag, it is not required by output only subdevices.
Remove the subdevice 'len_chanlist' initialization. This variable only
has meaning for subdevices that support asynchronous commands.
Remove the subdevice 'io_bits' initialization. Digital output subdevices
don't use this variable.
Remove the subdevice function pointers that evaluate to NULL based on the
boardinfo data.
Move the apci2200_do_insn_bits() function from the hwdrv_apci2200.c file
into the main driver file.
For aesthetic reasons, rename the #define used for the register used to
read/write the digital outputs..
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, 18 Jan 2013 00:40:01 +0000 (17:40 -0700)]
staging: comedi: addi_apci_2200: cleanup digital input subdevice
The board supported by this driver always has a digital input subdevice.
Remove the boardinfo for it and just open-code the relevant data in the
subdevice init.
Remove the SDF_GROUND and SDF_COMMON from the subdevice 'subdev_flags'.
These flags only have meaning for analog input/output subdevices.
Remove the subdevice 'len_chanlist' initialization. This variable only
has meaning for subdevices that support asynchronous commands.
Remove the subdevice 'io_bits' initialization. Digital input subdevices
don't use this variable.
Remove the subdevice function pointers that evaluate to NULL based on the
boardinfo data.
Move the apci2200_di_insn_bits() function from the hwdrv_apci2200.c file
into the main driver file.
For aesthetic reasons, rename the #define used for the register used to
read the digital inputs.
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, 18 Jan 2013 00:39:41 +0000 (17:39 -0700)]
staging: comedi: addi_apci_2200: remove interrupt support code
This board does not have any interrupt capable devices. Remove the
unused interrupt support 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 [Fri, 18 Jan 2013 00:39:24 +0000 (17:39 -0700)]
staging: comedi: addi_apci_2200: remove use of devpriv->s_EeParameters
This driver no longer reads the eeprom to find the board specific data,
all the necessary data is in the boardinfo. Use the boardinfo directly
instead of passing it through devpriv->s_EeParameters.
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, 18 Jan 2013 00:39:06 +0000 (17:39 -0700)]
staging: comedi: addi_apci_2200: don't read the unused PCI bars
This driver only uses PCI bar 1 (dev->iobase), don't bother reading
the unused PCI bars.
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, 18 Jan 2013 00:38:44 +0000 (17:38 -0700)]
staging: comedi: addi_apci_2200: remove devpriv->iobase usage
The iobase address stored in devpriv->iobase is also stored in
dev->iobase. Use that instead.
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, 18 Jan 2013 00:38:25 +0000 (17:38 -0700)]
staging: comedi: addi_apci_2200: remove unnecessary info from boardinfo
Remove the information from the boardinfo that was only needed to
work out the usage of the PCI bars.
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, 18 Jan 2013 00:38:01 +0000 (17:38 -0700)]
staging: comedi: addi_apci_2200: simplify the PCI bar reading
The board supported by this driver has a 93x76 eeprom. Knowing this
information allows simplifying the code that reads the PCI bars to
get the iobase addresses.
Also, since the 'dw_AiBase' is not ioremap'ed we can remove the iounmap
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>
H Hartley Sweeten [Fri, 18 Jan 2013 00:37:38 +0000 (17:37 -0700)]
staging: comedi: addi_apci_2200: absorb i_APCI2200_Reset()
This is the only 'reset' function used by the driver, remove it
from the boardinfo and absorb the code from hwdrv_apci2200.c into
the driver.
Rename the CamelCase function i_ADDI_Reset() to apci2200_reset().
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, 18 Jan 2013 00:37:11 +0000 (17:37 -0700)]
staging: comedi: addi_apci_2200: remove eeprom support code
Reading the eeprom on the board supported by this driver is not
necessary. All the information required is in the boardinfo.
Remove the eeprom support code since it's not really interesting
or useful.
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, 18 Jan 2013 00:36:50 +0000 (17:36 -0700)]
staging: comedi: addi_apci_2200: board does not have analog inputs
The board supported by this driver does not have analog inputs. Remove
the subdevice init for 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 [Fri, 18 Jan 2013 00:36:30 +0000 (17:36 -0700)]
staging: comedi: addi_apci_2200: board does not have analog outputs
The board supported by this driver does not have analog outputs. Remove
the subdevice init for 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 [Fri, 18 Jan 2013 00:36:10 +0000 (17:36 -0700)]
staging: comedi: addi_apci_2200: board does not have ttl i/o
The board supported by this driver does not have ttl i/o. Remove the
subdevice init for 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 [Fri, 18 Jan 2013 00:35:46 +0000 (17:35 -0700)]
staging: comedi: addi_apci_2200: separate from addi_common.c
This driver is for a simple 16 channel digital output (relays), 8 channel
digital input board. Using the addi-data "common" code introduces a lot
of bloat.
Copy the code in addi_common.c to this driver and remove the #include
that caused addi_common.c to be compiled with this driver. This will
allow removing the bloat.
Rename the auto_attach and detach functions so they have namespace
associated with this 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>
Malcolm Priestley [Thu, 17 Jan 2013 23:23:37 +0000 (23:23 +0000)]
staging: vt6656: cleanup vnt_manger.
Where appropriate replacing types defined in "type.h" with
linux/types.h.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Malcolm Priestley [Thu, 17 Jan 2013 23:21:50 +0000 (23:21 +0000)]
staging: vt6656: cleanup struct vnt_private
Where appropriate replacing types defined in "type.h" with
linux/types.h.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Malcolm Priestley [Thu, 17 Jan 2013 23:19:37 +0000 (23:19 +0000)]
staging: vt6656: staging: vt6656 change remaining to vnt_mgmt and remove typedef.
Use
struct vnt_manager
Move vnt_manager from sMgmtObj to vnt_mgmt.
and remove typedef from structures
vnt_private
vnt_manager
vnt_rx_mgmt
vnt_tx_mgmt
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Malcolm Priestley [Thu, 17 Jan 2013 23:17:21 +0000 (23:17 +0000)]
staging: vt6656: datarate/dpc/hostap/power use new structures.
Use
struct vnt_private
struct vnt_manager
Move vnt_manager from sMgmtObj to vnt_mgmt.
This patch cleans up function declarations, definitions and local variables
where appropriate replacing types defined in "type.h" with linux/types.h.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Malcolm Priestley [Thu, 17 Jan 2013 23:15:22 +0000 (23:15 +0000)]
staging: vt6656: change bssdb/rxtx/wpa2 to new structures
Use
struct vnt_private
struct vnt_manager
Move vnt_manager from sMgmtObj to vnt_mgmt.
This patch cleans up function declarations, definitions and local variables
where appropriate replacing types defined in "type.h" with linux/types.h.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John Stultz [Fri, 11 Jan 2013 23:46:24 +0000 (15:46 -0800)]
staging: alarm-dev: Implement compat_ioctl support
Implement compat_ioctl support for the alarm-dev ioctl.
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Colin Cross <ccross@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John Stultz [Fri, 11 Jan 2013 23:46:23 +0000 (15:46 -0800)]
staging: alarm-dev: Refactor alarm-dev ioctl code in prep for compat_ioctl
Cleanup the Android alarm-dev driver's ioctl code to refactor it
in preparation for compat_ioctl support.
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Colin Cross <ccross@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John Stultz [Fri, 11 Jan 2013 23:46:22 +0000 (15:46 -0800)]
staging: alarm-dev: Drop pre Android 1.0 _OLD ioctls
Per Colin's comment:
"The "support old userspace code" comment for those two ioctls has
been there since pre-Android 1.0. Those apis are not exposed to
Android apps, I don't see any problem deleting them."
Thus this patch removes the ANDROID_ALARM_SET_OLD and
ANDROID_ALARM_SET_AND_WAIT_OLD ioctl compatability
logic.
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Colin Cross <ccross@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peter Huewe [Mon, 14 Jan 2013 21:00:55 +0000 (22:00 +0100)]
staging/comedi/ni_labpc_cs: Convert to module_comedi_pcmcia_driver
This patch removes the boring init/exit functions with the new
module_comedi_pcmcia_driver macro.
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>
Peter Huewe [Mon, 14 Jan 2013 21:00:54 +0000 (22:00 +0100)]
staging/comedi/ni_daq_700: Convert to module_comedi_pcmcia_driver
This patch removes the boring init/exit functions with the new
module_comedi_pcmcia_driver macro.
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>
Peter Huewe [Mon, 14 Jan 2013 21:00:53 +0000 (22:00 +0100)]
staging/comedi/das08_cs: Convert to module_comedi_pcmcia_driver
This patch removes the boring init/exit functions with the new
module_comedi_pcmcia_driver macro.
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>
Peter Huewe [Mon, 14 Jan 2013 21:00:52 +0000 (22:00 +0100)]
staging/comedi/cb_das16_cs: Convert to module_comedi_pcmcia_driver
This patch removes the boring init/exit functions with the new
module_comedi_pcmcia_driver macro.
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>
Peter Huewe [Mon, 14 Jan 2013 21:00:51 +0000 (22:00 +0100)]
staging/comedi/quatech_daqp_cs: Convert to module_comedi_pcmcia_driver
This patch removes the boring init/exit functions with the new
module_comedi_pcmcia_driver macro.
Also removed the superflous #ifdef MODULE
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>
Peter Huewe [Mon, 14 Jan 2013 21:00:50 +0000 (22:00 +0100)]
staging/comedi/ni_mio_cs: Convert to module_comedi_pcmcia_driver
This patch removes the boring init/exit functions with the new
module_comedi_pcmcia_driver macro.
Also removed the superflous #ifdef MODULE
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>
Peter Huewe [Mon, 14 Jan 2013 21:00:49 +0000 (22:00 +0100)]
staging/comedi/ni_daq_dio24: Convert to module_comedi_pcmcia_driver
This patch removes the boring init/exit functions with the new
module_comedi_pcmcia_driver macro.
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>
Peter Huewe [Mon, 14 Jan 2013 21:00:48 +0000 (22:00 +0100)]
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>
Jake Champlin [Thu, 17 Jan 2013 13:55:30 +0000 (08:55 -0500)]
Staging: Comedi: ni_tio: Fixed spacing issue
Fixed coding style issue from spaces to tabs.
Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Thu, 10 Jan 2013 17:38:20 +0000 (10:38 -0700)]
staging: comedi: comedi_buf: remove noise in comedi_buf_read_free()
If an attempt is made to free more bytes than have been allocated
a dev_info message is output and the number of bytes to free is
adjusted to the allocated size.
Telling the user this happened is just noise. Remove the message.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbobbi@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Thu, 10 Jan 2013 17:37:56 +0000 (10:37 -0700)]
staging: comedi: comedi_buf: remove noise in comedi_buf_write_free()
If an attempt is made to free more bytes than have been allocated
a dev_info message is output and the number of bytes to free is
adjusted to the allocated size.
Telling the user this happened is just noise. Remove the message.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbobbi@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Thu, 10 Jan 2013 17:37:27 +0000 (10:37 -0700)]
staging: comedi: comedi_buf: remove unreachable dev_warn in comedi_buf_munge()
Due to the 'while(count < num_bytes)' the computed 'block_size' will
always be a value greater than 0.
Remove the unreachable dev_warn and the (block_size < 0) test.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbobbi@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Thu, 10 Jan 2013 17:36:58 +0000 (10:36 -0700)]
staging: comedi: comedi_buf: remove BUG_ON in comedi_buf_munge()
The condition that would trigger this BUG_ON can never occur.
The 'munge_count' will be equal to 'buf_write_count' if all the data
in the buffer has been munged.
Or, the 'munge_count' will be less than the 'buf_write_count' if any
partial samples in the buffer were not munged.
The 'munge_count' will never be greater than the 'buf_write_count'.
Remove the unnecessary BUG_ON.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbobbi@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Wed, 9 Jan 2013 20:32:56 +0000 (13:32 -0700)]
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:32:18 +0000 (13:32 -0700)]
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:31:46 +0000 (13:31 -0700)]
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:31:16 +0000 (13:31 -0700)]
staging: comedi: comedi_buf: clarify comedi_buf_read_free()
Reword the comment about the need for the smp_mb().
Clarify the check to make sure the number of bytes to free is not
more than the number of bytes allocated.
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:30:49 +0000 (13:30 -0700)]
staging: comedi: comedi_buf: clarify comedi_buf_read_alloc()
Clarify the check to make sure the number of bytes to allocate is
available.
Reword the comment about the need for the smp_rmb().
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:30:22 +0000 (13:30 -0700)]
staging: comedi: comedi_buf: cleanup comedi_buf_read_n_available()
For aesthetic reasons, cleanup this function a bit.
Change the (async == NULL) test to simply (!async).
Reword the comment about the need for the smp_rmb()..
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:29:53 +0000 (13:29 -0700)]
staging: comedi: comedi_buf: clarify comedi_buf_write_free()
Use the helper comedi_buf_write_n_allocated() to clarify the check
to make sure the number of bytes to free is not more than the number
of bytes allocated.
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:29:19 +0000 (13:29 -0700)]
staging: comedi: comedi_buf: cleanup comedi_buf_munge()
Refactor this function so there is a single return point and only
one BUG_ON check. The BUG_ON needs to be looked at to see if it
can be safely removed.
Clarify the test in the munge loop that checks for a block copy
that would extend pass the end of the prealloc_buf.
Reword the comment about the need for the smp_wmb().
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:28:20 +0000 (13:28 -0700)]
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:27:48 +0000 (13:27 -0700)]
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:27:07 +0000 (13:27 -0700)]
staging: comedi: comedi_buf: rename comedi_reset_async_buf()
For aesthetic reasons, rename this function to comedi_buf_reset(). This
makes all the asynchronous buffer functions have the same namespace.
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:26:26 +0000 (13:26 -0700)]
staging: comedi: comedi_buf: factor out new buffer allocation code
The function comedi_buf_alloc() first frees any allocated buffer then,
optionally, allocates a new buffer.
Factor out the new buffer allocation code to a new function. This
allows reducing the indent level and makes the code a bit cleaner.
Also, cleanup to factored out code to make it a bit more concise.
Use a local variable for the current comedi_buf_page being allocated.
This cleans up the ugly line breaks used to keep the lines < 80 chars.
Move the #ifdef'ery for the page protection determination out of the
vmap() call.
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:25:54 +0000 (13:25 -0700)]
staging: comedi: comedi_buf: factor out common code to free the async buffer
The function comedi_buf_alloc() uses two loops to free the async buffer's
buf_page_list. The first one is used at the beginning to deallocate the
current buffer. The second is used to cleanup if the new buffer allocation
fails.
Factor out the common code to a new function.
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>
H Hartley Sweeten [Wed, 9 Jan 2013 20:25:06 +0000 (13:25 -0700)]
staging: comedi: separate out comedi_buf_* functions
Create a new file, comedi_buf.c, to hold all the comedi_async buffer
functions. Currently they are all in drivers.c and really don't have
any association with that source file.
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>
H Hartley Sweeten [Wed, 9 Jan 2013 16:46:10 +0000 (09:46 -0700)]
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>
Ian Abbott [Tue, 8 Jan 2013 13:27:48 +0000 (13:27 +0000)]
staging: comedi: (core): add comedi_dev_from_file_info()
Setting `info = comedi_file_info_from_minor(minor)` and `dev =
comedi_dev_from_minor(minor)` in the same function is a bit of a waste.
The latter function is just a call of the former followed by a
conditional return of an embedded pointer (`info->device`) or NULL. The
former function uses a spin-lock which is where the wastfulness comes
in.
Move the "followed by a conditional return of an embedded pointer" part
into a new function `comedi_dev_from_file_info` and call this instead of
`comedi_dev_from_minor()` in the places where
`comedi_file_info_from_minor()` is also called.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Omar Ramirez Luna [Thu, 10 Jan 2013 09:37:02 +0000 (03:37 -0600)]
staging: tidspbridge: remove unused code to handle iva_img
There is no way to specify the value of iva_img and since this code
is not being used, remove it.
This analysis resulted from a report by
Chen Gang <gang.chen@asianux.com>, mentioning that the existing code
was wrongly specifying the size to be copied.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Omar Ramirez Luna [Thu, 10 Jan 2013 09:37:01 +0000 (03:37 -0600)]
staging: tidspbridge: use scm functions to set boot address and mode
Instead of ioremapping SCM registers, use the correspondent layer
to write into them.
This allows us to get rid of a layer violation, since the registers
are no longer touched by driver code.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Omar Ramirez Luna [Thu, 10 Jan 2013 09:37:00 +0000 (03:37 -0600)]
staging: tidspbridge: fix uninitialized variable sym_name
On both counts, sym_name could be printed uninitialized, this
is solved by moving the pr_* statement to be triggered if the
value is assigned.
Reported-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Omar Ramirez Luna [Thu, 10 Jan 2013 09:36:59 +0000 (03:36 -0600)]
staging: tidspbridge: fix memory corruption on long string names
The value allocated doesn't match the one that is meant to be
stored, resulting in corruption of memory for longer strings
that can't be held in such space.
Fix by allocating the correct byte value for the string meant to
be stored.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>