Commit Graph

468668 Commits

Author SHA1 Message Date
H Hartley Sweeten
b1598f9403 staging: comedi: skel: use comedi_subdevice 'readback'
Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up a bit.

Add a comment about the 'readback' member.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:22:30 -07:00
H Hartley Sweeten
d276206692 staging: comedi: add a 'readback' member to comedi_subdevice
The analog output hardware in most comedi drivers does not provide a
way to readback to last values written to the channels. In order to
provide an (*insn_read) for the analog output subdevice, the comedi
drivers save the last values for each channel in the private data.

Add a new member, 'readback', to the comedi_subdevice definition to
provide a common way to save these values.

Introduce a comedi core function, comedi_alloc_subdev_readback(), to
allocate the memory needed to save the values. This memory will be
automatically kfree'd when the driver is detached.

Introduce a comedi core function, comedi_readback_insn_read(), that
the comedi drivers can use for the (*insn_read) of a subdevice to
return the saved values for each channel.

This will allow removing the boilerplate in the comedi drivers to
return the saved values. In some drivers it will also allow removing
the private data completely.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:22:29 -07:00
H Hartley Sweeten
d0be943042 staging: comedi: addi_apci_1032: remove deadcode in apci1032_cos_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:52 -07:00
H Hartley Sweeten
cc67b0167a staging: comedi: addi_apci_1564: remove deadcode in apci1564_cos_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
b3cdebbfe2 staging: comedi: addi_apci_2032: remove deadcode in apci2030_int_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
b7e8472206 staging: comedi: amplc_pc236_common: remove deadcode in pc236_intr_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
68bd0f6f3c staging: comedi: comedi_parport: remove deadcode in parport_intr_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
079d062fb5 staging: comedi: dt3000: remove deadcode in dt3k_ai_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
6883565484 staging: comedi: gsc_hpdi: remove deadcode in gsc_hpdi_cmd_test()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
8d44945dc4 staging: comedi: me4000: fix aref test in ai_write_chanlist()
The 'aref' (CR_AREF) values are all AREF_* defines. The SDF_* defines are
subdevice flags. Fix the test in this function.

Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
a7dab19845 staging: comedi: me4000: fix aref test in me4000_ai_check_chanlist()
The 'aref' (CR_AREF) values are all AREF_* defines. The SDF_* defines are
subdevice flags. Fix the test in this function.

Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
88eb626a7e staging: comedi: ni_6527: remove deadcode in ni6527_intr_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
f8ee13c662 staging: comedi: ni_65xx: remove deadcode in ni_65xx_intr_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
b32381c5a8 staging: comedi: ni_mio_common: remove deadcode in ni_cdio_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
cad6daded3 staging: comedi: ni_mio_common: remove deadcode in ni_ai_insn_config()
The previous mask by 0xf ensures that calib_source will not be > 0xf.
Remove the dead code.

Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
0557344e21 staging: comedi: ni_mio_common: fix local var for 32-bit read
The local variable 'd' is used to read a 32-bit register. One branch of
the code shifts the register value 16 bits to the right to get the high
16-bits. Change the type of the local variable so that this shift works
correctly.

Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:51 -07:00
H Hartley Sweeten
ae2aef64fb staging: comedi: ni_tiocmd: remove deadcode in ni_tio_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:50 -07:00
H Hartley Sweeten
e24e9216ed staging: comedi: usbdux: remove deadcode in pcl726_intr_cmdtest()
Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:50 -07:00
H Hartley Sweeten
25e9398734 staging: comedi: usbdux: fix errno (EL2NSYNC) check
These should both be checking the -errno.

Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:50 -07:00
H Hartley Sweeten
d77ac2c487 staging: comedi: usbduxsigma: fix kcalloc 'size' argument
This code wants to allocate two arrays of struct urb pointers not two
arrays of struct urb objects. The size argument for both kcalloc calls
should be sizeof(urb) not sizeof(*urb).

Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:50 -07:00
H Hartley Sweeten
3f15f7ccfc staging: comedi: usbduxsigma: fix errno (EL2NSYNC) check
These should both be checking the -errno.

Reported by: coverity
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:20:50 -07:00
Ian Abbott
1b41976933 staging: comedi: ni_labpc: split common code to ni_labpc_common
The "ni_labpc" module is a Comedi driver for the National Instruments
Lab-PC series of ISA data acquistion boards, and also provides common
code for the "ni_labpc_pci" and "ni_labpci_cs" modules (for PCI boards
and PCMCIA cards).

Split out the common code into a new module "ni_labpc_common", leaving
the driver for the ISA boards in the existing "ni_labpc" module.  This
removes the C preprocessor conditional directives from the resulting
".c" files (although they remain in the included header file
"ni_labpc_isadma.h").

Unneccessary `#include` directives have been removed from the resulting
".c" files.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:18:56 -07:00
Ian Abbott
9439881a38 staging: comedi: ni_labpc: break lines after operators
For consistency, break lines before operators, not after.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:18:56 -07:00
Ian Abbott
4e3f39b166 staging: comedi: ni_labpc: Logical continuations should be on the previous line
Fix checkpatch issues "CHECK: Logical continuations should be on the
previous line".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:18:56 -07:00
Ian Abbott
bd98a4abff staging: comedi: ni_labpc: Alignment should match open parenthesis
Fix checkpatch issues "CHECK: Alignment should match open parenthesis".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:18:56 -07:00
Ian Abbott
6569f09827 staging: comedi: ni_labpc: use braces on all arms of if statement
Fix checkpatch issues "CHECK: braces {} should be used on all arms of
this statement".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:18:56 -07:00
Ian Abbott
13fec56c96 staging: comedi: ni_labpc: remove unnecessary braces in labpc_common_attach()
Correct checkpatch issue "WARNING: braces {} are not necessary for any
arm of this statement".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:18:56 -07:00
Julia Lawall
bdbb051220 staging: lustre: adjust spacing within pointer casts
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
expression e;
@@
 (
- T *
+ T *
 )
 e
// </smpl>

This semantic patch just removes the cast and adds it back, but when it
does so, it follows the spacing conventions of Linux.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:17:51 -07:00
Chase Southwood
ea2e318268 staging: comedi: s626: remove unnecessary variable initialization
We initialize 'irqbit' to 0, only to properly set it immediately
afterwards.  Just remove the zero-initialization.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:16:19 -07:00
Chase Southwood
adb7a4777b staging: comedi: dt2801: change function return type to void
cppcheck was complaining that the variable 'stat' is being reassigned
before the old value is used.  Upon inspection, I found that
dt2801_writecmd() cannot fail, always returns 0, and most callers already
do not bother with assigning its return value anyway, so it makes sense to
just change the return type for this function from int to void, and remove
the two assignments to 'stat'.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:16:19 -07:00
Chase Southwood
cb3f491d31 staging: comedi: dt3000: remove unneeded variable
Coccinelle (using scripts/coccinelle/tests/doublebitand.cocci) found this
assignment because 0 is or'd twice.  Upon inspection, I found that the
variable "mode" is only assigned once and used once, and thus can be
cleanly removed.  This patch plugs its value straight into writew() and
then removes the variable.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:16:19 -07:00
Chase Southwood
b5283aab04 staging: comedi: addi_apci_1564: correct typo in macro definition
A recent commit introduced a typo in the definition of
APCI1564_DO_CC_INT_DISABLE.  The macro is not use yet, so not a huge deal,
but this patch corrects it.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:16:19 -07:00
Chase Southwood
6caf601588 staging: comedi: addi_apci_1564: add whitespace to subdevice init
For purely aesthetic purposes, add some whitespace to subdevice initialization.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:16:19 -07:00
Eli Billauer
2d7f1d1c37 staging: xillybus: Removed read barrier at beginning of ISR
The comment (also removed) explains why it was there in the first place, but
that doesn't make much sense.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:14:41 -07:00
Eli Billauer
9959078c96 staging: xillybus: Removed unnecessary smp_wmb()
These memory barriers were added "just to be safe".

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:14:41 -07:00
Eli Billauer
21fc0b9f9d staging: xillybus: Removed write memory barriers before wait_event_*()
According to Documentation/memory-barriers.txt, a memory barrier is put
in place by wait_event_*()

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:14:41 -07:00
Eli Billauer
9fdde3668f staging: xillybus: Removed mmiowb() as iowrite32() is ordered
mmiowb() was used to make sure that iowrite32() take place in the correct
order, which is an unnecessary precuation.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:14:41 -07:00
Eli Billauer
f66a49766f staging: xillybus: Removed mmiowb() before mutex_unlock()
The relevant sequences consist of two I/O memory writes. The second write
depends on the first one. mmiowb() was inserted to make sure that no other
thread inserts a "first write" before the current one finished its second.

As a mutex protects this critical sequence, mmiowb() is unnecessary.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:14:41 -07:00
Eli Billauer
a5b2e028bb staging: xillybus: Remove mmiowb() before wait_event_*() calls
According to Documentation/memory-barriers.txt, a memory barrier is put
in place by wait_event_*()

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:14:41 -07:00
Greg Kroah-Hartman
a4102f90e8 staging: remove nokia_hp4p driver
The Bluetooth maintainer has been complaining about it for a while, and
I shouldn't have merged it over his objections.  There also has been no
real work done on it at all to get it out of the staging tree, so just
delete the code for now.

If someone wants to get this fixed up properly, feel free to revert this
commit and send the revert, along with cleanups and we will be glad to
consider it.

Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>,
Cc: Miguel Oliveira <cmroliv@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:10:25 -07:00
Andrew Plummer
86128a0dd6 Staging: bcm: LeakyBucket: format kernel-docs
Remove insignificant spaces before tabs in comments.

Signed-off-by: Andrew Plummer <plummer574@gmail.com>
Reviewed-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:08:42 -07:00
Matthias Beyer
7f90417bb9 Staging: bcm: Bcmnet.c: Renamed variable: "IntfAdapter" -> "intf_ad"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:02:23 -07:00
Matthias Beyer
9dd1e5542c Staging: bcm: Bcmnet.c: Renamed variable: "psIntfAdapter" -> "intf_ad"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:02:23 -07:00
Matthias Beyer
d07b030130 Staging: bcm: Bcmnet.c: Renamed variable: "Adapter" -> "ad"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:02:23 -07:00
Matthias Beyer
e324ae64c6 Staging: bcm: Bcmchar.c: Renamed variable: "NOB" -> "nob"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:01:39 -07:00
Matthias Beyer
b67bc7788f Staging: bcm: Bcmchar.c: Renamed variable: "pTarang" -> "tarang"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:01:39 -07:00
Matthias Beyer
ad4a9e6d99 Staging: bcm: Bcmchar.c: Renamed variable: "stTimeElapsedSinceNetEntry" -> "time_elapsed_since_net_entry"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:01:39 -07:00
Matthias Beyer
bafa367468 Staging: bcm: Bcmchar.c: Renamed variable: "DevInfo" -> "dev_info"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:01:39 -07:00
Matthias Beyer
bd8107b2b2 Staging: bcm: Bcmchar.c: Renamed variable: "RxCntrlMsgBitMask" -> "rx_cntrl_msg_bit_mask"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:01:39 -07:00
Matthias Beyer
1b2318a19f Staging: bcm: Bcmchar.c: Renamed variable: "ReadOffset" -> "read_offset"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:01:39 -07:00