Commit graph

21825 commits

Author SHA1 Message Date
Matthias Oefelein 1b42f1d954 beeceem: Fix missing spaces around operators and unwanted spaces around semicolons in InterfaceRx.c
Checkpatch reports missing spaces around operators; this patch
introduces spaces where needed.
Spaces before semicolons are prohibited by the official coding style
guidelines, those have been fixed as well.

Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:59:27 -08:00
Ralph Mueck 4dcce62eaf beeceem: Replace C99-style comments with C89 pendants in InterfaceTx.c
Checkpatch complains about the use of //-comments, thus they are replaced by C89-style comments.

Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:57:33 -08:00
Ralph Mueck d1c6c9caaf beeceem: Fix position of braces in conditional statements in InterfaceTx.c
This corrects the position of (opening) braces in if-conditionals to make checkpatch shut up.

Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:57:33 -08:00
Ralph Mueck 5bbf5e66ab beeceem: Add spaces before opening parentheses in if-conditionals in InterfaceTx.c
This patch adds spaces before the opening parentheses of if-conditionals to comply with offical code styling guidelines.

Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:57:32 -08:00
Ralph Mueck e84b8bacf3 beeceem: Fix several whitespace issues in InterfaceTx.c
This patch takes care of the following issues:
	- missing spaces at variable assignments
	- missing spaces between function arguments
	- spaces at the beginning of a line where tabs should be
	- prohibited spaces before a (semi)colon

Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:57:32 -08:00
Laura Abbott 175f5475fb staging: lustre: Use is_vmalloc_addr
Instead of manually checking the bounds of VMALLOC_START and
VMALLOC_END, just use is_vmalloc_addr. That's what the function
was designed for.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:54:32 -08:00
Ben Hutchings 731becf831 staging: lustre: Make LUSTRE_LLITE_LLOOP tristate
There seems to be no reason why it can't be a module; in fact that is
currently supposed to be the default.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:53:26 -08:00
Masanari Iida 83bffc8125 staging: lustre: Remove braces for single statement in kernel_user_comm.c
This patch fixed "WARNING: braces {} are not necessary for
single statement blocks" found by checkpatch.pl in
kernel_user_comm.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:52:43 -08:00
Masanari Iida 5152bda8ee staging: lustre: Fix do not use C99 // comments in lcommon_cl.c
This patch fixed "ERROR: do not use C99 // comments" found by
checkpatch.pl in lcommon_cl.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:52:43 -08:00
Masanari Iida d063192134 staging: lustre: Fix space prohibited between function name and open parenthesis in lcommon_cl.c
This patch fixed "WARNING: space prohibited between function name
and open parenthesis '(' found by checkpatch.pl,
in lustre/lclient/lcommon_cl.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:52:43 -08:00
Masanari Iida 57c4b12734 staging: lustre: Fix do not use C99 // comments in mgc_request.c
This patch fixed "ERROR: do not use C99 // comments"
found by checkpatch.pl in lustre/lustre/mgc_request.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:50:34 -08:00
Masanari Iida 3126b4d121 staging: lustre: Fix brace {} are not necessary for single statement blocks
This patch fixed "WARNING: braces {} are not necessary for
single statement blocks" in lustre/lustre/mgc_request.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:50:34 -08:00
Masanari Iida 37821997e7 lustre: Fix space required before the open parenthesis in mgc_required.c
This patch fixed "ERROR: space required before the open
parenthesis'('" found by checkpatch.pl in
lustre/lustre/mgc/mgc_request.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:50:34 -08:00
Rashika Kheria f4ad847a9f drivers: dgnc: Include appropriate header file in dgnc_trace.c
Include appropriate header file dgnc/dgnc_trace.h in dgnc_trace.c
because function dgnc_tracer_free() has its prototype declaration in the
header file.

This eliminates the following warning in dgnc_trace.c:
drivers/staging/dgnc/dgnc_trace.c:180:6: warning: no previous prototype for ‘dgnc_tracer_free’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:47:35 -08:00
Rashika Kheria f5aae444ae drivers: bcm: Remove unused function in nvm.c
Remove unused function PropagateCalParamsFromEEPROMToMemory() in nvm.c.

This eliminates the following warning in nvm.c:
drivers/staging/bcm/nvm.c:1369:5: warning: no previous prototype for ‘PropagateCalParamsFromEEPROMToMemory’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:46:08 -08:00
Rashika Kheria 8e586897d4 drivers: bcm: Mark functions as static in Qos.c
Mark functions MatchSrcIpAddress(), MatchDestIpAddress() and MatchTos()
as static in Qos.c because they are not used outside this file.

This eliminates the following warnings in Qos.c:
drivers/staging/bcm/Qos.c:27:6: warning: no previous prototype for ‘MatchSrcIpAddress’ [-Wmissing-prototypes]
drivers/staging/bcm/Qos.c:61:6: warning: no previous prototype for ‘MatchDestIpAddress’ [-Wmissing-prototypes]
drivers/staging/bcm/Qos.c:94:6: warning: no previous prototype for ‘MatchTos’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:46:08 -08:00
Rashika Kheria 39e2ce9a35 drivers: sbe-2t3e3: Mark functions as static in ctrl.c
Mark functions t3e3_set_loopback(), t3e3_reg_read(), t3e3_reg_write(),
t3e3_port_get(), t3e3_port_set(), t3e3_port_get_stats() and
t3e3_port_del_stats() as static in ctrl.c because they are not used
outside this file.

This eliminates the following warnings in ctrl.c:
drivers/staging/sbe-2t3e3/ctrl.c:34:6: warning: no previous prototype for ‘t3e3_set_loopback’ [-Wmissing-prototypes]
drivers/staging/sbe-2t3e3/ctrl.c:98:6: warning: no previous prototype for ‘t3e3_reg_read’ [-Wmissing-prototypes]
drivers/staging/sbe-2t3e3/ctrl.c:135:6: warning: no previous prototype for ‘t3e3_reg_write’ [-Wmissing-prototypes]
drivers/staging/sbe-2t3e3/ctrl.c:167:6: warning: no previous prototype for ‘t3e3_port_get’ [-Wmissing-prototypes]
drivers/staging/sbe-2t3e3/ctrl.c:172:6: warning: no previous prototype for ‘t3e3_port_set’ [-Wmissing-prototypes]
drivers/staging/sbe-2t3e3/ctrl.c:219:6: warning: no previous prototype for ‘t3e3_port_get_stats’ [-Wmissing-prototypes]
drivers/staging/sbe-2t3e3/ctrl.c:285:6: warning: no previous prototype for ‘t3e3_port_del_stats’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:45:24 -08:00
Rashika Kheria 22bf290e88 drivers: sm7xxfb: Mark function as static in sm7xxfb.c
Mark function smtcfb_setmode() as static in sm7xxfb.c because it is not
used outside this file.

This eliminates the following warning in sm7xxfb.c:
drivers/staging/sm7xxfb/sm7xxfb.c:588:6: warning: no previous prototype for ‘smtcfb_setmode’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:45:24 -08:00
Rashika Kheria 634fc892de drivers: dgap: Include appropriate header file in dgap_parse.c
Include appropriate header file in dgap/dgap_parse.h in dgap_parse.c
because functions dgap_parsefile(), dgap_config_get_useintr(),
dgap_config_get_altpin(), dgap_find_config(),
dgap_config_get_number_of_ports(), dgap_create_config_string() and
dgap_get_config_letters() have their prototype declarations in the
header file.

This eliminates the following warnings in dgap_parse.c:
drivers/staging/dgap/dgap_parse.c:125:5: warning: no previous prototype for ‘dgap_parsefile’ [-Wmissing-prototypes]
drivers/staging/dgap/dgap_parse.c:1101:6: warning: no previous prototype for ‘dgap_config_get_useintr’ [-Wmissing-prototypes]
drivers/staging/dgap/dgap_parse.c:1128:6: warning: no previous prototype for ‘dgap_config_get_altpin’ [-Wmissing-prototypes]
drivers/staging/dgap/dgap_parse.c:1157:15: warning: no previous prototype for ‘dgap_find_config’ [-Wmissing-prototypes]
drivers/staging/dgap/dgap_parse.c:1223:6: warning: no previous prototype for ‘dgap_config_get_number_of_ports’ [-Wmissing-prototypes]
drivers/staging/dgap/dgap_parse.c:1252:7: warning: no previous prototype for ‘dgap_create_config_string’ [-Wmissing-prototypes]
drivers/staging/dgap/dgap_parse.c:1311:7: warning: no previous prototype for ‘dgap_get_config_letters’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:43:21 -08:00
Rashika Kheria 9c5f179196 drivers: dgap: Include appropriate header file in dgap_trace.c
Include appropriate header file dgap/dgap_trace.h in dgap_trace.c
because function dgap_tracer_free() have its prototype declaration in
the header file.

This eliminates the following warning in dgap_trace.c:
drivers/staging/dgap/dgap_trace.c:181:6: warning: no previous prototype for ‘dgap_tracer_free’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:43:21 -08:00
Liu Ying 7fc6cb2876 staging: imx-drm: imx-tve: Fix a sparse warning
This patch declares the function of_get_tve_mode
as a static one to fix this sparse warning:
drivers/staging/imx-drm/imx-tve.c:563:11: warning: \
symbol 'of_get_tve_mode' was not declared. \
Should it be static?

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:40:47 -08:00
Greg Kroah-Hartman 8a3cecf503 Third round of new drivers, features and cleanups for IIO in the 3.14 cycle.
One new driver a spot of new functionality and a cleanup.
 
 * New driver for the Capella CM32181 ambient light sensor. This is the first
   driver directly from Kevin at Capella with more already in the pipeline.
 * Support for configurable predividers on the mxs lradc
 * Convert a field to a bitmap in mxs lradc instead of using an array of
   unsigned longs to store boolean values.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJSzaveAAoJEFSFNJnE9BaInqIQAKZeBFS64HkWCU+fPF62gRCT
 VLkfPvzOSIYctKuTQCVggAeJUt6lDVZT23r/Oy2GSenkcvL/xVy+GRSFM6ZZ7vhN
 cyOHKwq1sSZV+ZSQNKdHxRAEla41qy8tvCKe1XseYKERi8JJnhxwB4Hcb1gTvmqo
 LN9wh1zfV5XZTq7i/vcBVVM/SYrDxJmapbNW1wa3Ytx65VzCYsb3iIHDzxaZh33Y
 WtjLRnyCDavTY19gg4K4/c6+IPgLi+VM2oN7GDdKSaT4jGAq5eVzrqWQ+s+WjAGj
 0HZ0dt6QDo21P0moO1RIhgE7uN3TpJeEHL1oB5SBV/0VpBcDcZDmaVz2VMQuL1Iv
 tmY0Gf4sz2z3VnbA7DfKWIUSpF8j2pnPPzUEC+wUrkP50QEwzbH5jsop8CzUa9PT
 Rm88DXKr7oUB3y8apC1HsadS1dnIr7wloZCj5gbQ70TnpJat625Y+mhKawRUUGms
 fSyY/C+O+5VrTw0+usCLB1EtMty2aDM/2pQcTiMdRvG58F9hIcpZTGybwViPQPta
 Lf1a82n5LF8HKrdq10mpCJnuB9VDoQqvdtPJDQ8QNFr6aGRih0HFliZ4OpGOD7mo
 bOj68VEI9u4Hjc7dUoZ6HLiA/v6mMUme01422dN5rRQmWjzeaEyQibAq3XZKnr4i
 gBnUKoGHFHil6KxOrYU3
 =VaZB
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-3.14c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third round of new drivers, features and cleanups for IIO in the 3.14 cycle.

One new driver a spot of new functionality and a cleanup.

* New driver for the Capella CM32181 ambient light sensor. This is the first
  driver directly from Kevin at Capella with more already in the pipeline.
* Support for configurable predividers on the mxs lradc
* Convert a field to a bitmap in mxs lradc instead of using an array of
  unsigned longs to store boolean values.
2014-01-08 12:23:35 -08:00
Martin Hofmann edd236afc8 vt6655: fix printk usage in wpactl.c
This patch fixes the usage of printk in wpactl.c concering one missing log level
occurence and some whitespaces before a newline.

Signed-off-by: Martin Hofmann <martin.hofmann@studium.uni-erlangen.de>
Signed-off-by: Michael Gunselmann <michael.gunselmann@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:06:10 -08:00
Martin Hofmann 91d9b19aeb vt6655: remove typedefs in wpactl.h
wpactl.h contained some typedefs for enums. These were removed in this patch.
Also, a typedef for a type "unsigned long long" that was only instantiated in
one place was removed and its declaration altered.

Signed-off-by: Martin Hofmann <martin.hofmann@studium.uni-erlangen.de>
Signed-off-by: Michael Gunselmann <michael.gunselmann@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:05:20 -08:00
Martin Hofmann 0027d9a7bd vt6655: fix indentation in wroute.c
This patch fixes indentation style belonging to function calls as well as some
run-away closing parentheses when calling functions.

Signed-off-by: Martin Hofmann <martin.hofmann@studium.uni-erlangen.de>
Signed-off-by: Michael Gunselmann <michael.gunselmann@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:04:46 -08:00
Martin Hofmann ed07c0e39b vt6655: remove unnecessary braces in wroute.c
This patch removes some unnecessary braces concerning if-statements in the file
wroute.c

Signed-off-by: Martin Hofmann <martin.hofmann@studium.uni-erlangen.de>
Signed-off-by: Michael Gunselmann <michael.gunselmann@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:04:46 -08:00
Martin Hofmann 85d396b5fd vt6655: remove casts in wroute.c
The file wroute.c contained some silly casts. This patch removes them.

Signed-off-by: Martin Hofmann <martin.hofmann@studium.uni-erlangen.de>
Signed-off-by: Michael Gunselmann <michael.gunselmann@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:04:46 -08:00
Martin Hofmann 4d60901849 vt6655: balance faulty parentheses in 80211hdr.h
The file 80211hdr.h contained the macro WLAN_GET_FC_PRVER(n). The big endian
fashion of this macro had unbalanced parentheses. This patch removes the
parentheses in question.

Signed-off-by: Martin Hofmann <martin.hofmann@studium.uni-erlangen.de>
Signed-off-by: Michael Gunselmann <michael.gunselmann@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:04:46 -08:00
Dan Carpenter 3b371fe4d2 staging: vt6656: remove an unneeded NULL check
We dereference "param->u.wpa_key.key" on the next line so the check
here is inconsistent.  This is only called from iwctl_siwencodeext() and
"param->u.wpa_key.key" is a valid pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:02:13 -08:00
Dan Carpenter 1c5ebaae42 staging: vt6655: check too restrictive (off by one)
key_len == MAX_KEY_LEN is valid but we return an error.

Introduced-by: 6b7200fe0a ('Staging: vt6655: memory corruption in check in wpa_set_wpadev()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:02:13 -08:00
Malcolm Priestley 6e28024e16 staging: vt6656: CARDqGetNextTBTT replace code using do_div.
uBeaconInterval becomes u32

get next TBTT value using vendor's equation as shown.

This patch was checked against the original code
and yields exactly the same value.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:02:13 -08:00
Malcolm Priestley 9acec059c0 staging: vt6656: CARDqGetNextTBTT correct uLowNextTBTT
value uLowNextTBTT yields wrong value.

ULL is needed with qwTSF

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: stable@vger.kernel.org # v3.9+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 11:02:13 -08:00
Simon Schuster 98e5491731 Staging: vt6656: Reduce line length of bssdb.c
Long lines are split into multiple ones to reduce the line length.
Additionally some alignment fixes are made that previous patches
missed.

Unfortunately, due to the high indentation levels present in parts of
bssdb.c, this patch leaves some lines which are longer than 80
characters.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:59 -08:00
Sebastian Rachuj 5918ed4203 Staging: vt6656: Remove explicit comparisons against NULL
Explicit comparisons of pointers agains NULL
(like if (p != NULL) ...) are not as readable as the implicit
comparison (like if (p) ...). This patch converts all these explicit
comparisons to implicit ones.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Sebastian Rachuj 72cac30225 Staging: vt6656: Remove bogus parentheses in conditions
Removes unrequired parentheses around comparisons in complex
conditions.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster 8f284d79fc Staging: vt6656: Combined nested conditions
This patch reduces the level of indentation in bssdb.c of the vt6656
driver by transforming nested conditions to a series of logical
conjunctions. E.g.

if (cond1) {
        if (cond2) {
                block();
        }
}

is transformed to

if (cond1 && cond2) {
        block();
}

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster b7fce6aec1 Staging: vt6656: Correct usage of braces
Conforming to the linux coding style guidelines, a single line block
of an if statement does not require curly braces unless another block
of the if cascade requires them. Therefore unnecessary curly braces
are removed by this patch and missing ones are added.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster fd2251e233 Staging: vt6656: Combine "else { if" to "else if"
This patch combines single ifs within the block of an else to a single
else if statement.

Therefore code that looks like that

else {
	if (cond) {
		statements;
	} else {
		other_statements;
	}
}

is converted to code that looks like that

else if (cond) {
	statements;
} else {
	other_statements;
}

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster 6c64bf8af9 Staging: vt6656: Remove unnecessary spaces in format strings
A space in a format string is unnecessary if it is followed by a line
feed. These spaces are removed by this patch.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster dad2ddbdbf Staging: vt6656: Remove line feeds before else
An else belongs in the same line as the closing curly brace of the
previous block. Hence, this patch removes line feeds separating a
curly brace from the corresponding else.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster 77226ed70b Staging: vt6656: Correct single space mistakes
Adds missing spaces between an if-statement and its condition as well
as between the condition and the following curly brace. At casts
there is also a space added between the type and the variable.

Spaces that either follow an opening parenthese or the sizeof operator
or that preceed semicolons are removed as well.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster e435ef1626 Staging: vt6656: Correct operator coding style
Adds spaces around operators (like &&, ||, !=, +, ...) and removes
spaces before postfix increment and decrement operators. Parentheses
around return values are removed, too.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster 13a36fe9aa Staging: vt6656: Remove unnecessary semicolons
After some blocks in bssdb.c there are semicolons that are not
required to be there. Therefore they are removed with this patch.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster 14feab1763 Staging: vt6656: Adjust comments in bssdb.c
Changes C99-style comments to C89-style ones to conform to the linux
coding guidelines. Additionally removes plus and minus signs from the
function description comments.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:58 -08:00
Simon Schuster 0863b4e21f Staging: vt6656: Fix indentation of bssdb.c
Corrects indentation by using tabs instead of spaces. This also
includes modification of the alignment of multi-line expressions and
statements.

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 17:17:54 -08:00
Johannes Berg 685328b296 mac80211: remove channel_change_time
This value is no longer used by mac80211, and practically no
driver ever set it to a correct value anyway, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-01-07 23:16:39 +01:00
Alexey Khoroshilov cd19f7d3e3 [media] as102: fix leaks at failure paths in as102_usb_probe()
Failure handling is incomplete in as102_usb_probe().
The patch implements proper resource deallocations.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:55:58 -02:00
Hans Verkuil 42f8f39e27 [media] [for,v3.14] sn9c102: fix build dependency
This driver should only build if MEDIA_USB_SUPPORT is set.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Jim Davis <jim.epost@gmail.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:49:01 -02:00
Hans Verkuil e0a973423e [media] davinci-vpfe: fix compile error
The include for delay.h was missing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:02:51 -02:00
Fengguang Wu 12d1ee1f2d [media] fix coccinelle warnings
drivers/staging/media/bcm2048/radio-bcm2048.c:2255:3-4: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: coccinelle/misc/semicolon.cocci

CC: Hans Verkuil <hans.verkuil@cisco.com>
CC: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:01:11 -02:00
Fengguang Wu 65eccc7a88 [media] fix coccinelle warnings
drivers/staging/media/bcm2048/radio-bcm2048.c:2632:1-7: Replace memcpy with struct assignment
/c/kernel-tests/src/cocci/drivers/staging/media/bcm2048/radio-bcm2048.c:744:1-7: Replace memcpy with struct assignment
/c/kernel-tests/src/cocci/drivers/staging/media/bcm2048/radio-bcm2048.c:2360:3-9: Replace memcpy with struct assignment

Generated by: coccinelle/misc/memcpy-assign.cocci

CC: Hans Verkuil <hans.verkuil@cisco.com>
CC: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:01:03 -02:00
Hans Verkuil 79aeb3f308 [media] vb2: return ENOBUFS in start_streaming in case of too few buffers
This works together with the retry_start_streaming mechanism to allow userspace
to start streaming even if not all required buffers have been queued.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Tomasz Stanislawski <t.stanislaws@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 07:13:49 -02:00
Wei Yongjun 66c5e59278 [media] radio-bcm2048: fix missing unlock on error in bcm2048_rds_fifo_receive()
Add the missing unlock before return from function bcm2048_rds_fifo_receive()
in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 06:49:51 -02:00
David S. Miller 56a4342dfe Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
	net/ipv6/ip6_tunnel.c
	net/ipv6/ip6_vti.c

ipv6 tunnel statistic bug fixes conflicting with consolidation into
generic sw per-cpu net stats.

qlogic conflict between queue counting bug fix and the addition
of multiple MAC address support.

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-06 17:37:45 -05:00
Dan Carpenter f7d40eea8e [media] v4l: omap4iss: Restore irq flags correctly in omap4iss_video_buffer_next()
The spin_lock_irqsave() macro is not nestable.  The second call will
overwrite the first record of "flags" so the IRQs will not be enabled
correctly at the end of the function.

In the current code, this function is always called from the IRQ handler
so everything works fine and this fix doesn't change anything.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-02 15:53:01 -02:00
Dan Carpenter eaf95eeec4 [media] v4l: omap4iss: use snprintf() to make smatch happy
Smatch complains here because name is a 32 character buffer and we
adding the "OMAP4 ISS " prefix as well for a total of 42 characters.
The sd->name buffer can only hold 32 characters.  I've changed it to use
snprintf() to silence the overflow warning.

Also I have removed the call to strlcpy() which is a no-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-02 15:52:35 -02:00
Craig Markwardt 66c65d90db iio: Fix a buffer overflow in iio_utils.h example code
This was originally reported by Craig Markwardt on Zubair Lutfullah's
blog and Zubair forwarded it to linux-iio@vger.kernel.org. No email
address known.

The code first counted the number of enabled channels, then created an
array to hold information about them.  The code that filled this array then
stored whether a given element was enabled inside the array.  Curriously
this element was never used.  Craig's patch added a local temporary variable
to avoid the buffer overrun.  Jonathan then removed the original enabled
element of the structure as it was not needed at all.

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-01 15:48:58 +00:00
Alexandre Belloni 38125b2c93 iio: mxs-lradc: convert is_divided to a bitmap
mxs_lradc.is_divided was an unsigned long array. Convert it to a bitmap to save
some memory.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-01 14:31:56 +00:00
Hector Palacios aba70f2a58 iio: mxs-lradc: add write_raw function to modify scale
Added write_raw function to manipulate the optional divider_by_two
through the scaling attribute out of the available scales.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-01 14:28:19 +00:00
Hector Palacios d5acf5942b iio: mxs-lradc: add scale_available file to channels
Adds in_voltageX_scale_available file for every channel to read
the different available scales.
There are two scales per channel:
 [0] = divider_by_two disabled (default)
 [1] = divider_by_two enabled
The scale is a struct made of integer and nano parts to build
a long decimal number.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-01 14:25:18 +00:00
Hector Palacios f6db68a405 iio: mxs-lradc: add scale attribute to channels
Some LRADC channels have fixed pre-dividers and all have an optional
divider by two which allows a maximum input voltage of VDDIO - 50mV.

This patch
 - adds the scaling info flag to all channels
 - grabs the max reference voltage per channel
   (where the fixed pre-dividers apply)
 - allows to read the scaling attribute (computed from the Vref)

Signed-off-by: Hector Palacios <hector.palacios@digi.com>.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-01 14:16:43 +00:00
Julia Lawall e9ed104de6 staging:iio:impedance:ad5933: correct error check
iio_kfifo_allocate returns NULL in case of error.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
identifier f;
statement S1,S2;
@@

*x = f(...);
 if (x) { <+... when != if (...) S1 else S2
     -ENOMEM ...+> }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
cc: stable@vger.kernel.org
2014-01-01 12:19:17 +00:00
Jens Axboe b28bc9b38c Linux 3.13-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJSwLfoAAoJEHm+PkMAQRiGi6QH/1U1B7lmHChDTw3jj1lfm9gA
 189Si4QJlnxFWCKHvKEL+pcaVuACU+aMGI8+KyMYK4/JfuWVjjj5fr/SvyHH2/8m
 LdSK8aHMhJ46uBS4WJ/l6v46qQa5e2vn8RKSBAyKm/h4vpt+hd6zJdoFrFai4th7
 k/TAwOAEHI5uzexUChwLlUBRTvbq4U8QUvDu+DeifC8cT63CGaaJ4qVzjOZrx1an
 eP6UXZrKDASZs7RU950i7xnFVDQu4PsjlZi25udsbeiKcZJgPqGgXz5ULf8ZH8RQ
 YCi1JOnTJRGGjyIOyLj7pyB01h7XiSM2+eMQ0S7g54F2s7gCJ58c2UwQX45vRWU=
 =/4/R
 -----END PGP SIGNATURE-----

Merge tag 'v3.13-rc6' into for-3.14/core

Needed to bring blk-mq uptodate, since changes have been going in
since for-3.14/core was established.

Fixup merge issues related to the immutable biovec changes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

Conflicts:
	block/blk-flush.c
	fs/btrfs/check-integrity.c
	fs/btrfs/extent_io.c
	fs/btrfs/scrub.c
	fs/logfs/dev_bdev.c
2013-12-31 09:51:02 -07:00
Olof Johansson e7d248f0e0 ARM: tegra: implement common DMA and resets DT bindings
This series converts the Tegra DTs and drivers to use the common/
 standard DMA and reset bindings, rather than custom bindings. It also
 adds complete documentation for the Tegra clock bindings without
 actually changing any binding definitions.
 
 This conversion relies on a few sets of patches in branches from outside
 the Tegra tree:
 
 1) A patch to add an DMA channel request API which allows deferred probe
    to be implemented.
 
 2) A patch to implement a common part of the of_xlate function for DMA
    controllers.
 
 3) Some ASoC patches (which in turn rely on (1) above), which support
    deferred probe during DMA channel allocation.
 
 4) The Tegra clock driver changes for 3.14.
 
 Consequently, this branch is based on a merge of all of those external
 branches.
 
 In turn, this branch is or will be pulled into a few places that either
 rely on features introduced here, or would otherwise conflict with the
 patches:
 
 a) Tegra's own for-3.14/powergate and for-4.14/dt branches, to avoid
    conflicts.
 
 b) The DRM tree, which introduces new code that relies on the reset
    controller framework introduced in this branch, and to avoid
    conflicts.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJSr3AnAAoJEMzrak5tbycxfMwQAMeffTFreJqDiQ4Vj0XmuhSn
 RFlXiZQsWtQ6gGgNfKyDsXzDMaz1KDAabcUYRcZwrluxuSCPBcK1JirCj5R8uRY7
 LDZFX92CO8zRgiij0mhgokV4zzuEQ56q1uhPxqI3o+wG3v44jlMSMgFHQJUevdET
 aKr2Pss8Hb00XDztnpxprs6FUoU/W99NRH0i/5znbBwuHqYFP37zlKe2MRwbqDwR
 AMgkrnGoawe85Stz4p/iR9pCLpAMa0dH94V4JrAP4+IQrl0DEKWbrolpQHii4gzh
 NCGazMELTqkaZaorC/n1SmczH1kTj4vcjbbmeB8dwS8Vqhr+uf7W1oLlJ46TUOsp
 ESO0uD2GfpHKQQwLxEfgjfmwsIUMbdWHef8f2HUuvl6Js+LCpaPkxd52Pt/qL4sU
 0sKqTbldRZXzGhvwa0/MK32WhmH4v31s7IZAg5A2YxqDR6yWryl7legWyvrI96C0
 OlmVe1C/2NGk0QCfK0G/xTa9V7YzMfj8k4ICSZOgUoF4BeGGj6d3svWvLbKbbrU1
 0fVvR7aCm78pRXixI6kURpj9D0mEfqus9Hx7VoWcL0TS4QH2dSYlGI+jDCiliQmj
 +kWrZWHsASSvPmUZk4RBNaviCbnGU8/t5nNdJSdFIUM/PIswzZ4GaAu6gdVksIY8
 hcx410PyAzTZL2lENamE
 =8T7+
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-3.14-dmas-resets-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/cleanup

From Stephen Warren:
ARM: tegra: implement common DMA and resets DT bindings

This series converts the Tegra DTs and drivers to use the common/
standard DMA and reset bindings, rather than custom bindings. It also
adds complete documentation for the Tegra clock bindings without
actually changing any binding definitions.

This conversion relies on a few sets of patches in branches from outside
the Tegra tree:

1) A patch to add an DMA channel request API which allows deferred probe
   to be implemented.

2) A patch to implement a common part of the of_xlate function for DMA
   controllers.

3) Some ASoC patches (which in turn rely on (1) above), which support
   deferred probe during DMA channel allocation.

4) The Tegra clock driver changes for 3.14.

Consequently, this branch is based on a merge of all of those external
branches.

In turn, this branch is or will be pulled into a few places that either
rely on features introduced here, or would otherwise conflict with the
patches:

a) Tegra's own for-3.14/powergate and for-4.14/dt branches, to avoid
   conflicts.

b) The DRM tree, which introduces new code that relies on the reset
   controller framework introduced in this branch, and to avoid
   conflicts.

* tag 'tegra-for-3.14-dmas-resets-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (30 commits)
  spi: tegra: checking for ERR_PTR instead of NULL
  ASoC: tegra: update module reset list for Tegra124
  clk: tegra: remove bogus PCIE_XCLK
  clk: tegra: remove legacy reset APIs
  ARM: tegra: remove legacy DMA entries from DT
  ARM: tegra: remove legacy clock entries from DT
  USB: EHCI: tegra: use reset framework
  Input: tegra-kbc - use reset framework
  serial: tegra: convert to standard DMA DT bindings
  serial: tegra: use reset framework
  spi: tegra: convert to standard DMA DT bindings
  spi: tegra: use reset framework
  staging: nvec: use reset framework
  i2c: tegra: use reset framework
  ASoC: tegra: convert to standard DMA DT bindings
  ASoC: tegra: allocate AHUB FIFO during probe() not startup()
  ASoC: tegra: call pm_runtime APIs around register accesses
  ASoC: tegra: use reset framework
  dma: tegra: register as an OF DMA controller
  dma: tegra: use reset framework
  ...

Signed-off-by: Olof Johansson <olof@lixom.net>
2013-12-26 10:33:05 -08:00
dingtianhong 93dc5e429b ozwpan: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Rupesh Gujare <rupesh.gujare@atmel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:34 -05:00
Greg Kroah-Hartman a6e8e3a470 2nd round of new IIO drivers, features and cleanups for the 3.14 cycle.
New drivers
 
 * HID inclinometer driver.
 
 * DHT11 humidity driver.  Note that previous humidity drivers have been in
   hwmon, but no one was ever entirely happy with that, and they should find
   a more comfortable home in IIO (their original placement in hwmon was my
   fault - oops).  As this is our first humidity driver, core support is also
   added.
 
 New features
 
 * Two of mxs-lradc channels are internally wired to a temperature sensor,
   make this explicit in the driver by providing the relevant temperature
   channel.
 
 * Add support for blocking IO on buffers.
 
 * Add a data_available call back to the interface between buffer implementations
   and the core.  This is much cleaner than the old, 'stufftoread' flag.
   Implemented in the kfifo buffer.
 
 Cleanups
 
 * Last user of the old event configuration interface is converted and the
   old interface dropped.  Nice to be rid of this thanks to Lars-Peter's hard
   work!
 
 * Replace all remaining instances of the IIO_ST macro with explicit filling
   of the scan_type structure within struct iio_chan_spec.  This macro was a
   bad idea, that rapidly ceased to cover all elements of the structure.
   Miss reading of the macro arguements has led to a number of bugs so lets
   just get rid of it. The final removal patch is awaiting for some fixes
   to make their way into mainline.
   In a couple of drivers, no elements of scan_type were even being used so
   in those case, it has been dropped entirely.
 
 * Drop a couple of of_match_ptr helper uses in drivers where devicetree is
   not optional and hence the structures being protected by this always exist.
 
 * Fix up some cases where data was read from a device in a particular
   byte order, but he code placed it into a s16 or similar.  These were
   highlighted by Sparse.
 
 * Use the new ATTRIBUTE_GROUPS macro to drop some boiler plate in the triggers
   core code.
 
 * ad7746 and ad7280a - stop storing buffers on the stack, giving cleaner code
   and possibly avoiding issues with i2c bus drivers that assume they can dma
   directly into the buffer.  Note that this cannot currently happen as the the
   i2c_smbus_read_i2c_block_data function has a memcpy from the buffer actually
   passed to the bus driver.  I missed this element of the commit message
   and don't think it is major enough to rebase the iio tree.
 
 * ad5791 and ad5504 stop storing buffers on the stack for an SPI driver.
   Unlike the i2c drivers, this is a real issue for SPI drivers which can dma
   directly into the buffer supplied.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJStyIbAAoJEFSFNJnE9BaI1goQAL0hKYCYuIl3d1fAy65u2I4h
 5mzJs/oJmomq/4BqAopfEQ8CbhZhksAYoR4JndOzZH7n4jVY/fRgyY/bH/Ymj0oI
 OpCtfee6IeeBLA0p8CMeEPem/pnwxRhSDzul9jsiwpTrTRKAIC1BPZwrmLpaoUfc
 obD8r1ocVZStzfsYBr3DUwkcIpcTQTCVy/Pl8HoKLKKsdYoFhTpNwEHJFOoZdiFi
 KKGRkeL9Q8VRWt/otWU0L0VFGZFwI1PWlxrqnbisVcGwSs8FF4wGcQvijfC0mUMg
 BdKDM7J4GrourZhj3og566B/8WMtGo6YTJXAe/QvvPp768rQncccDHem4V0Tnu49
 OJbjgD4ZGVXt3uBFaYddBIbMEIB8SfA2VYur/MW3gnZ7saSAtDk6TllsvC6CxIkR
 +LOOxWylhEGeJFIjyMrFPqRVhrrRNkuDRxPz8ZGTiDc8ovo6DWuTLsJrLSX8EJyZ
 O6TN6EEk8TCJaf8V63uTFW0Dlom4IQHyQei6LKhfhzwUQq/ri0esBp5P8lGzI3Uq
 wtOSdCDuYyoUEYPYbwjohFmQJ27w1rx9KcS4Y9BGmhTIRXslUg3hr+wA/gKMSDZ0
 /AUkLQajcv9otupfGzsp5mIWkthKKsGt/Y50xc5zIodnFtnM3nQGq4AqlP6t8nzP
 jucVwVMQLj5KaNH13P6K
 =Whfv
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-3.14b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

2nd round of new IIO drivers, features and cleanups for the 3.14 cycle.

New drivers

* HID inclinometer driver.

* DHT11 humidity driver.  Note that previous humidity drivers have been in
  hwmon, but no one was ever entirely happy with that, and they should find
  a more comfortable home in IIO (their original placement in hwmon was my
  fault - oops).  As this is our first humidity driver, core support is also
  added.

New features

* Two of mxs-lradc channels are internally wired to a temperature sensor,
  make this explicit in the driver by providing the relevant temperature
  channel.

* Add support for blocking IO on buffers.

* Add a data_available call back to the interface between buffer implementations
  and the core.  This is much cleaner than the old, 'stufftoread' flag.
  Implemented in the kfifo buffer.

Cleanups

* Last user of the old event configuration interface is converted and the
  old interface dropped.  Nice to be rid of this thanks to Lars-Peter's hard
  work!

* Replace all remaining instances of the IIO_ST macro with explicit filling
  of the scan_type structure within struct iio_chan_spec.  This macro was a
  bad idea, that rapidly ceased to cover all elements of the structure.
  Miss reading of the macro arguements has led to a number of bugs so lets
  just get rid of it. The final removal patch is awaiting for some fixes
  to make their way into mainline.
  In a couple of drivers, no elements of scan_type were even being used so
  in those case, it has been dropped entirely.

* Drop a couple of of_match_ptr helper uses in drivers where devicetree is
  not optional and hence the structures being protected by this always exist.

* Fix up some cases where data was read from a device in a particular
  byte order, but he code placed it into a s16 or similar.  These were
  highlighted by Sparse.

* Use the new ATTRIBUTE_GROUPS macro to drop some boiler plate in the triggers
  core code.

* ad7746 and ad7280a - stop storing buffers on the stack, giving cleaner code
  and possibly avoiding issues with i2c bus drivers that assume they can dma
  directly into the buffer.  Note that this cannot currently happen as the the
  i2c_smbus_read_i2c_block_data function has a memcpy from the buffer actually
  passed to the bus driver.  I missed this element of the commit message
  and don't think it is major enough to rebase the iio tree.

* ad5791 and ad5504 stop storing buffers on the stack for an SPI driver.
  Unlike the i2c drivers, this is a real issue for SPI drivers which can dma
  directly into the buffer supplied.
2013-12-24 10:30:57 -08:00
Greg Kroah-Hartman 99f14bd4d1 Merge 3.13-rc5 into usb-next
This resolves the merge issue with drivers/usb/host/ohci-at91.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-24 10:18:03 -08:00
Greg Kroah-Hartman b86b75ec57 Merge 3.13-rc5 into tty-next
We need the tty fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-24 10:10:47 -08:00
Greg Kroah-Hartman 912cbd4952 Merge 3.13-rc5 into staging-next
This resolves a merge issue with drivers/staging/imx-drm/imx-drm-core.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-24 10:06:37 -08:00
Sachin Kamat 6fd92d3add staging: iio: hmc5843: Remove redundant of_match_ptr helper
'hmc5843_of_match' is always compiled in. Hence the helper
macro is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-22 16:02:14 +00:00
Chris Bajumpaa 1785faacf3 staging: line6: Add support for POD HD400 to line6usb driver
This patch adds support for the Line 6 POD HD400 to the line6usb driver.

Signed-off-by: Chris Bajumpaa <cbajumpa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-21 16:03:34 -08:00
Larry Finger 17d4116595 staging: r8188eu: Fix unused variable warnings
A previous set of patches were test compiled with one of the configuration
variables not set. As a result, a number of unused variables were left in the
code.

In several instances, declaration of the unused variable was the only statement
inside ifdef .. endif pairs. In those cases, the entire block was removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 13:04:55 -08:00
Larry Finger 259cdb5fcd staging: r8188eu: Restore line that was incorrectly removed
A line in the P2P code had been removed in the process of converting the vendor
driver to a form suitable for the kernel. The output of this call was ignored,
and the initial analysis incorrectly determined that the call had no other
effect.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 13:04:55 -08:00
Wenliang Fan 1b1290e5ba drivers/staging/bcm: Integer overflow
The checking condition in 'validateFlash2xReadWrite()' is not
sufficient. A large number invalid would cause an integer overflow and
pass the condition, which could cause further integer overflows in
'Bcmchar.c:bcm_char_ioctl()'.

Signed-off-by: Wenliang Fan <fanwlexca@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 12:22:26 -08:00
H Hartley Sweeten 01b6442b46 staging: comedi: ni_660x: tidy up set_tio_counterswap()
Clean up the multi-line comment and tidy the function a bit.

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>
2013-12-20 11:49:34 -08:00
H Hartley Sweeten d783a20e8f staging: comedi: ni_660x: remove dma_selection_counter()
The counter->chip_index will always be < counters_per_chip due to the
initialization of the subdevices during the attach of the board.

The dma_selection_counter() helper just does a BUG_ON() check before
returning the original value. Just use the original value directly
in the caller and remove the helper function.

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>
2013-12-20 11:49:34 -08:00
H Hartley Sweeten 0c26c7ed76 staging: comedi: ni_660x: use a local var for the 'chip_index'
Use a local variable for the 'counter->chip_index' to help shorten the
long lines and clarify the code.

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>
2013-12-20 11:49:34 -08:00
H Hartley Sweeten 1246f05baa staging: comedi: ni_660x: rename the CamelCase enum NI_660x_Register and labels
As prefered by the CodingStyle, rename this CamelCase enum and its labels.

Also, cleanup the ni_gpct_to_660x_register() helper function. Just return the
ni_660x_register for each ni_gpct_register and remove the unnecessary break
statements after the return statements.

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>
2013-12-20 11:49:34 -08:00
H Hartley Sweeten 16cc181d63 staging: comedi: ni_tiocmd: make ni_tio_cmd() a proper comedi (*do_cmd)
Change the parameters to ni_tio_cmd() to make it a proper comedi
(*do_cmd) function.

The wrappers in the ni_660x and ni_mio_common modules are still needed
to request the mite channel and setup the device before actually doing
the command.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten c3f3b431de staging: comedi: ni_tiocmd: make ni_tio_cmdtest() a proper comedi (*do_cmdtest)
Change the parameters to ni_tio_cmdtest() to make it a proper comedi
(*do_cmdtest) function. This allows using it directly and removing the
wrapper functions in the ni_660x and ni_mio_common modules.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten cac04c0f68 staging: comedi: ni_tio: make ni_tio_insn_config() a proper comedi (*insn_config)
Change the parameters to ni_tio_insn_config() to make it a proper comedi
(*insn_config) function. This allows using it directly and removing the
wrapper functions in the ni_660x and ni_mio_common modules.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten 10f74377ee staging: comedi: ni_tio: make ni_tio_winsn() a proper comedi (*insn_write)
Change the parameters to ni_tio_winsn() to make it a proper comedi
(*insn_write) function. This allows using it directly and removing the
wrapper functions in the ni_660x and ni_mio_common modules.

For aesthetics, rename the function.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten 9014d816e5 staging: comedi: ni_tio: make ni_tio_rinsn() a proper comedi (*insn_read)
Change the parameters to ni_tio_rinsn() to make is a proper comedi
(*insn_read) function. This allows using it directly and removing the
wrapper functions in the ni_660x and ni_mio_common modules.

For aesthetics, rename the function.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten 00edbc31d8 staging: comedi: ni_tio.h: remove subdev_to_counter()
This inline helper function simply returns the s->private void *.
Remove the helper and just get the s->private void * directly where
needed.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten c2e11bb11d staging: comedi: ni_tio.h: remove 'extern' from exported function prototypes
The 'extern' is not required, remove it.

Tidy up the function prototypes a bit.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten f688d4a763 staging: comedi: ni_tio: move the MODULE_* stuff to the end of file
For aesthetics, move all the MODULE_* information to the end of the file.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten cafa814958 staging: comedi: ni_tiocmd: move the MODULE_* stuff to the end of file
For aesthetics, move all the MODULE_* information to the end of the file.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten fca7c1d753 staging: comedi: ni_tio: use a local var for the 'counter_index'
Use a local variable for the 'counter->counter_index' to help shorten the
long lines and ugly line breaks.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten 5382bfb978 staging: comedi: ni_tiocmd: use a local var for the 'counter_index'
Use a local variable for the 'counter->counter_index' to help shorten the
long lines and ugly line breaks.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten e6b1624aae staging: comedi: ni_tio_internal.h: add missing NITIO_*_REG macro
The "HW Save" registers are the only ones missing an access macro.
Add one for completness.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten 94baf025ba staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Interrupt_Enable_Reg()
The "Interrupt Enable" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:33 -08:00
H Hartley Sweeten c9d766d04a staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Status_Reg()
The "Status" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

Rename the define for the shared status register.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten e72ccb041b staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Interrupt_Acknowledge_Reg()
The "Interrupt Acknowledge" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten ff157abe21 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_ABZ_Reg()
The "ABZ" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 8cd3936e97 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_DMA_Status_Reg()
The "DMA Status" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 1dd26c2152 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_DMA_Config_Reg()
The "DMA Config" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 5f19efaca6 staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Joint_Status2_Reg()
The shared "Status2" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 450a7c43e8 staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Joint_Status1_Reg()
The shared "Status1" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten fc31c52f4c staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Joint_Reset_Reg()
The shared "Reset" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 96b6175aa3 staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Status_Reg()
The shared "Status" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 7a0894e0d4 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Second_Gate_Reg()
The "Second Gate" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 0412ea4696 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Counting_Mode_Reg()
The "Counting Mode" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 3da68f50f2 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Input_Select_Reg()
The "Input Select" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten cc7a164b16 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_LoadB_Reg()
The "LoadB" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:32 -08:00
H Hartley Sweeten 720712f439 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_LoadA_Reg()
The "LoadA" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:31 -08:00
H Hartley Sweeten 0101791e83 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Mode_Reg()
The "Mode" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:31 -08:00
H Hartley Sweeten 67c68de0f1 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_SW_Save_Reg()
The "SW Save" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:31 -08:00
H Hartley Sweeten e25ef74446 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Command_Reg()
The "Command" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:31 -08:00
H Hartley Sweeten e062f51b79 staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Autoincrement_Reg()
The "AutoIncrement" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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>
2013-12-20 11:49:31 -08:00
H Hartley Sweeten 12375292ce staging: comedi: ni_tio.h: rename the CamelCase enum ni_gpct_register labels
As prefered by the CodingStyle, rename all the CamelCase labels of the
enum ni_gpct_register.

Cleanup all the helper functions in ni_tio_internal.h that used the enum.

The 'counter_index' parameter to all the functions is the ni_gpct_device
'counter_index' which is initialized when the subdevices are setup. This
value is always < 4 so the default: BUG() cases can never happen. For
aesthetics, rename the 'counter_idx' to simply 'idx' and fix the type in
some of the helpers.

Also, remove the unnecessary break statements after the return statements.

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>
2013-12-20 11:49:31 -08:00
Gokulnath Avanashilingam 8b80448d47 staging: bcm: fixed warning about no and prohibited space in InterfaceIdleMode.c.
This patch fixes all the warning related to spacing issues
found by checkpatch.pl script in InterfaceIdleMode.c

Signed-off-by: Gokulnath Avanashilingam <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:47:42 -08:00
Gokulnath Avanashilingam e42ff08dd9 staging: bcm: using time_after and time_before in InterfaceIdleMode.c
Used the time_after and time_before insted of comparing
the jiffies directly.This will fix the warnings and errors
found by the checkpatch.pl script.

Signed-off-by: Gokulnath Avanashilingam <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:47:42 -08:00
Gokulnath Avanashilingam 786bdddc36 staging: bcm: line over 80 characters in InterfaceIdleMode.c
Fixed all the line over 80 characters warning found by
checkpatch.pl script.

Signed-off-by: Gokulnath Avanashilingam <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:47:42 -08:00
Gokulnath Avanashilingam d52dd37e19 staging: bcm: Remove Developer Debug prints in InterfaceIdleMode.c
Removed the developer debug prints BCM_DEBUG_PRINT()
as per the TODO list, also removed braces for the
if-statement to match coding style

Signed-off-by: Gokulnath Avanashilingam <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:47:42 -08:00
Wei Yongjun a7c7eb03fd staging: sep: add missing destroy_workqueue() in sep_crypto.c
Add the missing destroy_workqueue() before return from
sep_crypto_setup() and sep_crypto_takedown().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:45:09 -08:00
Wei Yongjun b751bc77be staging: lustre: fix return value check in capa_hmac()
In case of error, the function crypto_alloc_hash() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:45:09 -08:00
Andreas Frembs a3c383c5c3 rlt8192e: Removing unused defines in rltlib_endianfree.h
Checkpatch mentioned that these macros should be defined with a 'do {...} while(0)' statement.
So we used grep to find all files using these macros and we found out that these macros were only used
in rtl819x_Qos.h, in the defines we removed before.
Since the macros are not used anywhere else we decided to remove them from the driver.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:41:28 -08:00
Andreas Frembs a1ca601aa2 rtl8192e: Removing unused defines in rtl819x_Qos.h
In rtl819x_Qos.h there were several macros defined but never used.
So we removed this macros.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:41:28 -08:00
Andreas Frembs 6e925e1991 rtl8192e: Fixing checkpatch errors
This patch fixes the following checkpatch errors from rtllib_endianfree.h:
 - ERROR: Macros with complex values should be enclosed in parenthesis

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:41:28 -08:00
Michael Hoefler 382d277b38 silicom: remaining checkpatch issues in bypass.c
In this patch we fix some "logical" errors in bypass.c of the silicom bypass
driver (in staging).

Checkpatch complains about the following errors:
 - unnecessary forward declarations in a source file
 - assignment in if condition

In addition to that the __init and __exit macros were missing at the init and
cleanup function.

There are still two warnings left for this file related to too many leadingtabs
at nested blocks. I did not touch this issue becasue the code needs really some
refactoring. And since i do not have the appropriate hardware to test the code,
i do not change the functionality in any way.

Signed-off-by: Michael Hoefler <michael.hoefler@studium.uni-erlangen.de>
Signed-off-by: Christoph Kohl <christoph.kohl@t-online.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 09:04:49 -08:00
Michael Hoefler 6618b75069 silicom: fix coding style issues in bypass.c
This patch improves bypass.c (in staging) in terms of coding style. This
includes different issues some of them mentioned by checkpatch:

 - a c++ one line comment
 - parenthesis at return statementes
 - multiple definitions in one line
 - missing braces according to the style guide

Signed-off-by: Michael Hoefler <michael.hoefler@studium.uni-erlangen.de>
Signed-off-by: Christoph Kohl <christoph.kohl@t-online.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 09:04:49 -08:00
Michael Hoefler 74552f1b2f silicom: fix whitespace issues in bypass.c
This patch addresses several problems in bypass.c found by checkpatch.
Furthermore it removes/adds some empty lines to make the code more readable.

The following problems are fixed:
 - line over 80 characters
 - space after logical operator !
 - spaces instead of tabs
 - missing empty line after local declarations
 - empty line after {

The empty line issues were not discovered by checkpatch but in my opinion these
changes make perfect sense in terms of readability.

Signed-off-by: Michael Hoefler <michael.hoefler@studium.uni-erlangen.de>
Signed-off-by: Christoph Kohl <christoph.kohl@t-online.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 09:04:49 -08:00
Larry Finger a322b495fa staging: r8188eu: Replace wrappers ODM_StallExecution, ODM_delay_us, and rtw_udelay_os
Each instance may bre replaced by udelay

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger 4063642bd4 staging: r8188eu: Replace wrappers ODM_delay_ms() and rtw_mdelay_os() with a simple mdelay
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger 0da46e6bb1 staging: r8188eu: Replace wrappers ODM_sleep_ms() and rtw_msleep_os() with a simple msleep
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger c01fb49636 staging: r8188eu: Replace rtw_get_current_time() with jiffies
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger 03f4a957e6 staging: r8188eu: Remove calls to _rtw_spinlock_free
This wrapper does nothing on Linux. When calls to it were removed, a number of
routines became empty and could also be removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger f214e521d9 staging: r8188eu: Remove wrapper around spin_lock_init
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger 597794f53e staging: r8188eu: Remove wrappers around spin_unlock_irqrestore
Again there are two - _exit_critical() and _exit_critical_ex().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger f937886ba9 staging: r8188eu: Remove wrappers for spin_lock_irqsave
There are two such wrappers - _enter_critical() and _enter_critical_ex().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger e02bcf6126 staging: r8188eu: Remove wrapper around spin_unlock_bh
With this change, a number of variables for storing flags are no longer used.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger 7057dcb3af staging: r8188eu: Remove wrapper around spin_lock_bh
Some comment lines that mentioned spin_lock_bh() are also removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Larry Finger dfa5e81e59 staging: r8188eu: Remove pointless thread_exit macro
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:57:45 -08:00
Lidza Louina 0c5b5632d2 staging: dgap: uses kzalloc for allocating memory
Originally, this driver created it's own allocating
function. This patch removes that function and calls
kzalloc directly.

This patch affects:
 - driver.c
 - driver.h
 - fep5.c
 - tty.c

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:54:46 -08:00
stalinsrinivasan.s f0dcc9fa42 staging: dgnc: fix checkpatch.pl usage of comparison with jiffies
This is a patch to the dgnc_cls.c file that fixes up comparison with
jiffies usage warning found by the checkpatch.pl tool

Signed-off-by: S. Stalin Srinivasan <stalinsrinivasan.s@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:54:46 -08:00
stalinsrinivasan.s 9979ef7d73 staging: dgnc: fix checkpatch.pl usage of volatile.
This is a patch to the dgnc_cls.c file that fixes up volatile usage
warning found by the checkpatch.pl tool

Signed-off-by: S. Stalin Srinivasan <stalinsrinivasan.s@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:54:46 -08:00
stalinsrinivasan.s cb3714a6b0 staging: dgnc: fix 80 characters per line limitation and code indent warnings.
This is a patch to the dgnc_cls.c file that
fixes up 80 characters per line and code indent
warnings found by the checkpatch.pl tool.

Signed-off-by: S. Stalin Srinivasan <stalinsrinivasan.s@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:54:46 -08:00
Hans Verkuil a03636cb21 [media] omap24xx/tcm825x: move to staging for future removal
The omap24xx driver and the tcm825x sensor driver are the only two
remaining drivers to still use the old deprecated v4l2-int-device API.

Nobody maintains these drivers anymore. But unfortunately the v4l2-int-device
API is used by out-of-tree drivers (MXC platform). This is a very bad situation
since as long as this deprecated API stays in the kernel there is no reason for
those out-of-tree drivers to convert.

This patch moves v4l2-int-device and the two drivers that depend on it to
staging in preparation for their removal.

If someone would be interested in getting these drivers to work, then start with
this since it's not very far from the state where they used to work:

<URL:http://vihersipuli.retiisi.org.uk/cgi-bin/gitweb.cgi?p=~sailus/linux-omap/.git;a=summary>

The branch is n800-cam. Porting to up-to-date APIs can then be done. David
might have done some work in that area, so check with him first.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: David Cohen <dacohen@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-20 13:45:22 -02:00
Hans Verkuil b8da9d3aaf [media] sn9c102: prepare for removal by moving it to staging
During the last media summit meeting it was decided to move this driver to
staging as the first step to removing it altogether.

Most webcams covered by this driver are now supported by gspca. Nobody has the
hardware to convert the remaining devices to gspca.

This driver needs a major overhaul to have it conform to the latest frameworks
and compliancy tests.

Without hardware, however, this is next to impossible. Given the fact that
this driver seems to be pretty much unused (it has been removed from Fedora
several versions ago and nobody complained about that), we decided to drop
this driver.

This patch moves it to staging. Some time in 2014 we will drop it completely.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-20 13:41:36 -02:00
John Stultz 07300f43d6 ion_test: Add compat_ioctl support (v2)
Prior to subitting this, Colin reworked the compat_ioctl support
for the ion_test driver, moving the structure to be the same size
on both 32 and 64 bit architectures.

Two small things were left out. The compat_ioctl ptr assignment,
and the fact that despite having uniform sized types in the
structure, the structure pads out to different sizes on different
arches.

This patch resolves this issue by adding a padding entry after
the write flag, and adding the compat_ioctl ptr.

Changes in v2:
- Add a padding int rather then making write a u64

Acked-by: Colin Cross <ccross@android.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>
2013-12-19 16:10:25 -08:00
Masanari Iida 364014fda8 staging: dgap: Fix trailing whitespace in dgap_trace.c
This patch fixed trailing whitespace found by
checkpatch.pl within dgap_trace.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-19 10:27:13 -08:00
Jiri Kosina e23c34bb41 Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply fixes on top of newer things
in tree (efi-stub).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-12-19 15:08:32 +01:00
Gokulnath A b3a53885b2 staging: bcm: line over 80 characters in InterfaceDld.c
Fixed all the line over 80 characters warning found by
checkpatch.pl script.

Signed-off-by: Gokulnath A <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18 16:24:17 -08:00
Gokulnath A 8f5157bf37 staging:bcm: Removed developer debug prints in InterfaceDld.c
Removed the developer debug prints BCM_DEBUG_PRINT()
as per the TODO list, also removed braces for the
if-statement to match coding style

Signed-off-by: Gokulnath A <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18 16:24:17 -08:00
Gary Rookard 2d3fd5cabb Staging: bcm: DDRInit: fixed up some commenting issues.
I have deleated some unintelligible comments, and made a
few minor white space corrections.

Signed-off-by: Gary Alan Rookard
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18 16:22:11 -08:00
Masanari Iida 258726b350 staging: dgap: Fix trailing whitespace in dgap_tty.c
This patch fixed "ERROR:trailing whitespace
found by checkpatch.pl within dgap_tty.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18 16:21:13 -08:00
Masanari Iida ebca68f69d staging: dgap: Fix trailing whitespace in downld.c
This patch fix "ERROR: trailing whitespace found by
checkpatch.pl, whithin downld.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18 16:20:37 -08:00
Aaron Sierra 7e4290c6db vme_user: Use __u64 and __u32 in userspace structs
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18 16:20:13 -08:00
Aaron Sierra 89b1cc2dcb vme_user: Enable compat_ioctl for mixed environment
Now that the VME userspace API structures compile to a consistent size
in mixed environments (32-bit userspace and 64-bit kernel), enable the
.compat_ioctl to allow ioctls to execute in this environment.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18 16:20:12 -08:00
Lisa Nguyen 3e6e3b3d3d [media] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c
Rewrite the return statement in vpfe_video.c. This will prevent
the checkpatch.pl script from generating a warning saying
to remove () from this particular return statement.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18 06:28:13 -02:00
Lisa Nguyen c324981d3b [media] staging: media: davinci_vpfe: Remove spaces before semicolons
Remove unnecessary spaces before semicolons to meet kernel
coding style.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18 06:27:59 -02:00
Gary Rookard c891d80318 Staging: bcm: DDRInit: fixed issues w/ commenting.
removed C99 comments to follow the linux kernel coding style
thus fixing checkpatch errors respectfully.

Signed-off-by: Gary Alan Rookard <garyrookard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:17:57 -08:00
John Stultz 6a72a700f4 staging: ion: Avoid using rt_mutexes directly
RT_MUTEXES can be configured out of the kernel, causing compile
problems with ION.

To quote Colin:
"rt_mutexes were added with the deferred freeing feature.  Heaps need
to return zeroed memory to userspace, but zeroing the memory on every
allocation was causing performance issues.  We added a SCHED_IDLE
thread to zero memory in the background after freeing, but locking the
heap from the SCHED_IDLE thread might block a high priority allocation
thread for a long time.

The lock is only used to protect the heap's free_list and
free_list_size members, and is not held for any long or sleeping
operations.  Converting to a spinlock should prevent priority
inversion without using the rt_mutex.  I'd also rename it to free_lock
to so it doesn't get used as a general heap lock."

Thus this patch converts the rt_mutex usage to a spinlock and
renames the lock free_lock to be more clear as to its use.

I also had to change a bit of logic in ion_heap_freelist_drain()
to safely avoid list corruption.

Acked-by: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:16:51 -08:00
Matthias Wirth 7dcfee65a1 rtl8188eu: remove unused code
These two macros needed reformatting but as they are not used anywhere we
just removed them.

Signed-off-by: Matthias Wirth <matthias.wirth@gmail.com>
Signed-off-by: Lukas Senger <lukas@fridolin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:16:51 -08:00
Matthias Wirth 282956c606 rtl8188eu: fix coding style
Signed-off-by: Matthias Wirth <matthias.wirth@gmail.com>
Signed-off-by: Lukas Senger <lukas@fridolin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:16:51 -08:00
Matthias Wirth f8d8f6f268 rtl8188eu: fix whitespace and indentation
Signed-off-by: Matthias Wirth <matthias.wirth@gmail.com>
Signed-off-by: Lukas Senger <lukas@fridolin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:16:51 -08:00
Russell King fd6040ed57 imx-drm: imx-drm-core: improve safety of imx_drm_add_crtc()
We must not add more CRTCs than we have declared to the vblank
helpers, otherwise we overflow their arrays.  Force failure if we
exceed the number of CRTCs.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:12:55 -08:00
Russell King 9fe73d46ed imx-drm: imx-drm-core: make imx_drm_crtc_register() safer
imx_drm_crtc_register() doesn't clean up the CRTC upon failure, which
leaves the CRTC attached to the DRM device.  Also, it does setup after
attaching the CRTC to the DRM device.

Fix this by reordering the function such that we do the setup before
drm_crtc_init(): this fixes both issues.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:12:55 -08:00
Russell King 942325c8b2 imx-drm: imx-drm-core: use defined constant for number of CRTCs.
We have this definition, there's no reason not to use it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:12:55 -08:00
Russell King bd5121bbb6 imx-drm: imx-tve: don't call sleeping functions beneath enable_lock spinlock
Enable lock claims that it is serializing tve_enable/disable calls.
However, DRM already serialises mode sets with a mutex, which prevents
encoder/connector functions being called concurrently.  Secondly,
holding a spinlock while calling clk_prepare_enable() is wrong; it
will cause a might_sleep() warning should that debugging be enabled.
So, let's just get rid of the enable_lock.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:12:55 -08:00
Russell King 4ae078d58a imx-drm: ipu-v3: fix potential CRTC device registration race
Clean up the IPUv3 CRTC device registration; we don't need a separate
function just to call platform_device_register_data(), and we don't
need the return value converted at all.

Update the IPU client id under a mutex, so that parallel probing
doesn't race.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:11:39 -08:00
Russell King 8007875f06 imx-drm: imx-drm-core: fix DRM cleanup paths
We must call drm_vblank_cleanup() on the error cleanup and unload paths
after we've had a successful call to drm_vblank_init().  Ensure that
the calls are in the reverse order to the initialisation order.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:09:52 -08:00
Russell King 82832046e2 imx-drm: imx-drm-core: fix error cleanup path for imx_drm_add_crtc()
imx_drm_add_crtc() was kfree'ing the imx_drm_crtc structure while
leaving it on the list of CRTCs.  Delete it from the list first.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:09:51 -08:00
Eli Billauer 9340e9dc9d staging: xillybus: Return -EIO if *_iomap fails, instead of 0
This patch replicates the correction made by Wei Yongjun on a second
occurrence of the same bug.

The first correction was in commit 8eec455551.

Bug fixed: The error code was not set, so the error condition wasn't reflected
in the return value.

Reported-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:07:13 -08:00
Alan 2d32927127 usbip: Fix sscanf handling
Scan only to the length permitted by the buffer

One of a set of sscanf problems noted by Jackie Chang

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:07:13 -08:00
Aaron Sierra 66a01f1158 vme_user: Update API to work in mixed environments
This patch updates the vme_master and vme_slave structures to use
types with well defined size and to prevent the compiler from
inserting padding (between enable and vme_addr for one).

The original vme_master and vme_slave structs would be different
sizes and have different layouts depending on whether they were built
for a 32-bit or 64-bit system.

On x86 it is possible to have a 32-bit userspace and a 64-bit kernel.
In this type of environment, the userspace and kernel vme_user APIs
would disagree and prevent ioctls from executing (based on ioctl
signatures from _IOR and _IOW).

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:06:19 -08:00
Jonathan Cameron 83d5f3246f staging:iio:ad799x fix incorrect endianness specification for buffer elements
Due to use of the IIO_ST macro, the endianness element of scan_type was
not being set.  The result is that it will default to the cpu endianness
whereas this driver will fill the buffer with big endian data.  Thus for
little endian machines, userspace will miss interpret the data.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-12-17 21:50:54 +00:00
Jonathan Cameron 5ae5285906 staging:iio:ad7606 replaces IIO_ST macro with explicit entries to struct scan_type
IIO_ST is going away as it is a pain to maintain. Note that this driver
currently ensures all fields are converted to the native endianness
to keep things consistent across the different bus types.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-12-17 21:40:04 +00:00
Bernd Porr e56b140105 staging: comedi: fix result of memdup_user for user chanlist
If the channel list is not set in userspace we get an error at
PTR_ERR(async->cmd.chanlist). However, do_become_nonbusy(dev, s) cleans
up this pointer which causes a kernel ooops. Setting the channel list in
async to NULL and checking this in do_become_nonbusy prevents the oops.

[Ian Abbott] Also do the same for the chanlist allocated in
do_cmdtest_ioctl().

Signed-off-by: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:10:40 -08:00
Masanari Iida b163970fa5 staging: keucr: Fix typo in keucr driver
Correct spelling typo in comment and printk.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:10:40 -08:00
Malcolm Priestley 7387f438e5 staging: vt6656: clean up CARDbSetMediaChannel.
White space and commented out code.

Camel case clean up.
pDevice -> priv
uConnectionChannel -> connection_channel

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:10:40 -08:00
Ian Abbott 1363e4fb4f staging/comedi: bug fix for module usage count on device removal
When a dynamically created comedi device is being automatically removed
by a call to `comedi_auto_unconfig()` from the lower level driver,
`comedi_device_cleanup()` is called to perform the detachment from the
lower level driver.  If the comedi device is open at the time,
`dev->use_count` will be the the number of outstanding opens.  The
function currently decrements the the module counts of the "comedi"
module and the low-level driver module by this amount and reduces
`dev->use_count` to zero.  There are various problems with this as the
`release` file operation handler `comedi_close()` also decrements
`dev->use_count` and decrements the module usage counts.  This means
that `dev->use_count` and the module counts can end up negative.

Also, the assumed one-to-one relationship between the file open count
and the low-level module usage count is invalid and can get screwed up.
We only want to stop the low-level module being unloaded while a comedi
device using the module has an open file object.

Also, there is no need to manipulate the module count of the core
"comedi" module at all since the comedi module is the owner of the file
operations structure and the system will not unload the module while
there are open file objects using it.

Correct the bugs and simplify as follows:

1. Get rid of the module count manipulations of the core "comedi" module
(`THIS_MODULE`) altogether.

2. Don't alter `dev->use_count` in `comedi_device_cleanup()` as it
should only be altered by the `open` and `release` file operation
handlers `comedi_open()` and `comedi_close()`.

3. Increment the low-level module count for the following reasons:

  a) In `comedi_open()` if the open count was zero and the comedi device
     is attached to the low-level driver.
  b) When the `COMEDI_DEVCONFIG` ioctl is used to manually attach an
     unattached comedi device to a low-level driver.  The open count
     will be greater than zero at this time.  The actual increment of
     the low-level module count is already done by
     `comedi_device_attach()`.

4. Decrement the low-level module count for the following reasons:

  a) In `comedi_close()` if the open count was 1 and the comedi device
     is attached to the low-level driver.
  b) In `comedi_device_cleanup()` (called via `comedi_auto_unconfig()`
     --> `comedi_release_hardware_device()` -->
     `comedi_free_board_dev()` when the comedi device is automatically
     unconfigured due to action by the low-level driver) if the device
     was attached (which it should be) and open count was non-zero
     (greater than zero).
  c) When the `COMEDI_DEVCONFIG` ioctl is used to manually detach the
     comedi device from the low-level driver.  The open count will be
     greater than zero at this time.

The open count should never go negative.  Parts 3 and 4 ensure that the
low-level module usage count is incremented on entering the state where
the comedi device is attached to the low-level driver AND the open count
is greater than zero, and is decremented on leaving that state.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:09:43 -08:00
Ian Abbott 8f988d8784 staging/comedi: keep reference to class device after destroyed
When a dynamically allocated `struct comedi_device` gets automatically
unconfigured by a call to `comedi_auto_unconfig()` from a lower-level
driver's bus removal function (e.g. when a USB device is disconnected),
the class device in `dev->class_dev` (where `dev` points to the `struct
comedi_device`) is destroyed by a call to `device_destroy()` that
matches a previous call to `device_create()`.

However, if the `struct comedi_device` is still associated with an open
file object, the now invalid `dev->class_dev` pointer may still be
passed to `dev_printk()` (via `dev_dbg()` etc.), producing bogus output
or worse.

To fix this, call `get_device()` on the class device if
`device_create()` was successful.  Add a matching call to `put_device()`
in `comedi_dev_kref_release()` when the `struct comedi_device` is freed.
The calls to `dev_dbg()` etc. after the call to `device_destroy()` will
still produce valid output, although the device will have been
unregistered in sysfs.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:09:43 -08:00
Ivaylo Dimitrov a3b22220a4 Staging: TIDSPBRIDGE: Remove UUID helper
Custom uuid helper function is needed only in rmgr/dbdcd.c and doesn't
need to be exported. It can also be made way simpler by using sscanf.

Signed-off-by: Ivaylo Dimitrov <freemangordon@abv.bg>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:09:09 -08:00
Malcolm Priestley 1fd4f55b53 staging: vt6656: Remove unused scStatistic data/functions from driver.
None of these stats reach user. So delete them from driver

mib.c and mib.h becomes dead code as result of this patch.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:09:09 -08:00
Malcolm Priestley 1aec87a561 staging: vt6656: dead code remove mib.c mic.h from driver.
As result of patch
staging: vt6656: Remove unused scStatistic data from driver.

mib.c mic.h is dead code

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:09:09 -08:00
H Hartley Sweeten c6236c0ce3 staging: comedi: drivers: fix return value of comedi_load_firmware()
Some of the callback functions that upload the firmware in the comedi
drivers return a positive value indicating the number of bytes sent
to the device. Detect this condition and just return '0' to indicate
a successful upload.

Reported-by: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:05:53 -08:00
Ian Abbott 0283f7a100 staging: comedi: 8255_pci: fix for newer PCI-DIO48H
At some point, Measurement Computing / ComputerBoards redesigned the
PCI-DIO48H to use a PLX PCI interface chip instead of an AMCC chip.
This meant they had to put their hardware registers in the PCI BAR 2
region instead of PCI BAR 1.  Unfortunately, they kept the same PCI
device ID for the new design.  This means the driver recognizes the
newer cards, but doesn't work (and is likely to screw up the local
configuration registers of the PLX chip) because it's using the wrong
region.

Since  the PCI subvendor and subdevice IDs were both zero on the old
design, but are the same as the vendor and device on the new design, we
can tell the old design and new design apart easily enough.  Split the
existing entry for the PCI-DIO48H in `pci_8255_boards[]` into two new
entries, referenced by different entries in the PCI device ID table
`pci_8255_pci_table[]`.  Use the same board name for both entries.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stablle <stable@vger.kernel.org> # 3.10.y # 3.11.y # 3.12.y # 3.13.y
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 13:05:53 -08:00
Jonathan Cameron c5fe7a41ad staging:iio:mag:hmc5843 fix incorrect endianness of channel as a result of missuse of the IIO_ST macro.
This driver sets the shift value equal to IIO_BE (or 1) rather than setting
that to 0 and specificying the endianness.  This means the channel type is
missreported as
[be|le]:u16/16>>1 where the be|le is dependent on the cpu native endianness,
rather than
be:u16/16>>0 resulting in any userspace code using this information, miss
converting the channel and generating thoroughly trashed data.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: stable@vger.kernel.org
2013-12-17 20:32:52 +00:00
Paul Gortmaker 885a947e5b staging: delete non-required instances of include <linux/init.h>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:08:14 -08:00
Steven Luo ed75098fd1 Staging: TIDSPBRIDGE: Fix mmap to map the correct region of physical memory
Commit 559c71fe5d ("Staging: TIDSPBRIDGE: Use vm_iomap_memory for
mmap-ing instead of remap_pfn_range") had the effect of inadvertently
shifting the start of the physical memory area mapped by
pdata->phys_mempool_base.  Correct this by subtracting that shift before
calling vm_iomap_memory() and adding it back afterwards.

Reported-by: Dheeraj CVR <cvr.dheeraj@gmail.com>
Signed-off-by: Ivaylo Dimitrov <freemangordon@abv.bg>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:07:39 -08:00
ZHAO Gang 76981cf1a1 staging: et131x: improve code consistency: access struct tx_ring
Let all the code use a pointer called tx_ring to access struct tx_ring
members.

Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:06:53 -08:00
ZHAO Gang 8f7fa96a0f staging: et131x: improve code consistency: access struct rx_ring
Let all the code use a pointer called rx_ring to access struct rx_ring
members.

Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:06:53 -08:00
H Hartley Sweeten 481ac51025 staging: comedi: s626: tidy up comedi_lrange table
The comedi_lrange tables are fixed length based on the 'length' value
before the array of comedi_krange 'range' values. For aesthetics, remove
the trailing comma from last 'range' value.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 7cd10fa64c staging: comedi: adl_pci9111: tidy up comedi_lrange tables
Tidy up the format of the comedi_lrange table.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 348dc03eb8 staging: comedi: adv_pci1724: tidy up comedi_lrange tables
Tidy up the format of the comedi_lrange table.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 67b3b78f5d staging: comedi: usbduxfast: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 168a21038a staging: comedi: ni_at_a2150: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE macro instead of the more generic RANGE macro to
reduce the potential for typos.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten c7b51165a6 staging: comedi: comedi_test: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten eff3689b0f staging: comedi: dyna_pci10xx: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 93626a45ae staging: comedi: me4000: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 3e54cdb1fd staging: comedi: icp_multi: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 84a8e0de48 staging: comedi: aio_aio12_8: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten f5a9097ec2 staging: comedi: pcl816: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:47 -08:00
H Hartley Sweeten 170341e42d staging: comedi: fl512: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 0b4c89d8bb staging: comedi: das16m1: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 1c6d126061 staging: comedi: adq12b: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 45ddfc5a51 staging: comedi: dmm32at: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 1179b1d780 staging: comedi: amplc_pci230: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten a19d98244e staging: comedi: ni_pcimio: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo errors.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 2cdbefe627 staging: comedi: amplc_pci224: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 713d551274 staging: comedi: adl_pci9118: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 53a38e23cd staging: comedi: das1800: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo errors.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 0bb7781b43 staging: comedi: dt282x: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo errors.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 3cdabd5d30 staging: comedi: dt2811: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo errors.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten af71a895dd staging: comedi: ni_atmio16d: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 1491ca0d9a staging: comedi: cb_pcidas: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten 9cbde70ced staging: comedi: dt2801: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo errors.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten be5bf02782 staging: comedi: das08: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:46 -08:00
H Hartley Sweeten bdaa61406c staging: comedi: adv_pci1710: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:45 -08:00
H Hartley Sweeten 4cdd4eb2d3 staging: comedi: pcl818: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:45 -08:00
H Hartley Sweeten 82dc1255a7 staging: comedi: cb_pcidas64: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:45 -08:00
H Hartley Sweeten daed6c7284 staging: comedi: ni_mio_common: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo errors.

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>
2013-12-17 10:05:45 -08:00
H Hartley Sweeten 8fcc322884 staging: comedi: pcl812: tidy up comedi_lrange tables
Tidy up the whitespace in the comedi_lrange tables.

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>
2013-12-17 10:05:45 -08:00
H Hartley Sweeten 90daf69a7a staging: comedi: addi_apci_1032: fix subdevice type/flags bug
The SDF_CMD_READ should be one of the s->subdev_flags not part of
the s->type.

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>
2013-12-17 10:03:03 -08:00
H Hartley Sweeten a92fe15636 staging: comedi: pcmmio: fix final checkpatch warning
Fis the last checkpatch.pl warning in this driver:

WARNING: space prohibited between function name and open parenthesis '('
+           comedi_buf_put (s->async, val >> 16)) {

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten a88a6376de staging: comedi: pcmmio: tidy up the multi-line comments
Tidy up the multi-line comments are the beginning of the file to follow
the CodingStyle.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten 500821f312 staging: comedi: pcmmio: update the MODULE_DESCRIPTION
Change the MODULE_DESCRIPTION to something more usefull than the
generic "Comedi low-level driver".

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten 748cfd987b staging: comedi: pcmmio: return '0' after successful attach
The comedi core expects the (*attach) functions to return < 0 to indicate
an error or >= 0 for success. Change the return to '0' as that is more
typical.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten 23bafad0d1 staging: comedi: pcmmio: cleanup the private data
Fix the types of some of the private data members. The 'enabled_mask' and
'stop_count' should be unsigned int values. The 'active' and 'continuous'
members are flags, change them to unsigned int bit fields.

Remove the 'sprivs' pointer. This should have been removed when the subdevice
private data was removed.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten f41520de5b staging: comedi: pcmmio: remove unused defines
These defines are not longer used in the driver. Remove them.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten c5b970aeb9 staging: comedi: pcmmio: tidy up pcmmio_start_intr()
Refactor the function to remove some indent levels.

Use pcmmio_dio_write() to write the polarity and enable paged registers
instead of using the for () loop to write each register in the pages.

The for () loop actually has a bug. It switches the page to the 'enab'
registers for the first port then switches to the 'pol' registers for
all remaining writes. It also was not using the pagelock spinlock to
protect the writes to the page registers. Using the pcmmio_dio_write()
helper ensures that the writes to the paged registers complete correctly.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten 2eb6b51822 staging: comedi: pcmmio: setup irq routing during (*attach)
To use interrupts the IRQ routing must be configured and interrupts
enabled. Currently both steps are being handled in pcmmio_start_intr().

Move the code that sets the IRQ routing into the attach of the board.
At this point interrupts are still disabled. The enable and polarity
bits just need to be set in pcmmio_start_intr() to enable them.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten 5181886e78 staging: comedi: pcmmio: only hook up async command support if irq is available
Refactor the board attach so that the async commands support is only
hooked up if the irq is actually available.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten d7c41e83e2 staging: comedi: pcmmio: tidy up pcmmio_handle_dio_intr()
Refactor the code to remove some of the indent levels.

Remove 'mytrig', the shift and mask end up making it the same as 'triggered'
anyway.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten 967e7e5a99 staging: comedi: pcmmio: factor the trigger handling out of interrupt_pcmmio()
Factor the code that actually handles the digital input triggers out of
the interrupt handler.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten eacc792d2c staging: comedi: pcmmio: use pcmmio_dio_{read, write}() in interrupt_pcmmio()
Use the helper functions to read/write the PCMMIO_PAGE_INT_ID registers. This
allows removing the need to lock/unlock the spinlock 'pagelock' and removes the
need for the for () loop that did the read/write of the 3 paged registers.

Also, remove the need for the 'got1' local variable by just returning 'IRQ_NONE'
if there are not interrupts pending.

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>
2013-12-17 10:02:14 -08:00
H Hartley Sweeten cd756e3d1b staging: comedi: pcmmio: cleanup indent levels in interrupt_pcmmio()
Remove the extra indent levels in this function that resulted from
code removed in previous patches.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 0cc9a4e4b6 staging: comedi: pcmmio: use comedi_legacy_detach() for (*detach)
The (*detach) of this driver just calls comedi_legacy_detach(). Use that
directly for the (*detach).

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 35c5e88498 staging: comedi: pcmmio: remove subdevice private data
Only subdevice[2], the dio interrupt subdevice, uses the subdevice private data.
Move the members from struct pcmmio_subdev_private to struct pcmmio_private and
remove the subdevice private data. This also allows removing the allocation and
freeing of devpriv->sprivs.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 518bf39f74 staging: comedi: pcmmio: remove 'num_asic_chans' from subdevice private data
The 'num_asic_chans' that support interrupts in the interrupt subdevice is
always initialized to '24'. Remove this unneeded information from the subdevice
private data.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 8fba3e5b1f staging: comedi: pcmmio: remove 'asic_chan' from subdevice private data
The first 'asic_chan' that supports interrupts in the interrupt subdevice is
always initialized to '0'. Remove this unneeded information from the subdevice
private data.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten b346c318b7 staging: comedi: pcmmio: remove 'first_chan' from subdevice private data
The 'first_chan' that supports interrupts in the interrupt subdevice is always
initialized to '0'. Remove this unneeded information from the subdevice private
data.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 8c41e9f41b staging: comedi: pcmmio: remove 'asic' member from subdevice private data
This member of the subdevice private data is always initialized to '0' by
the only subdevice that uses it. Since we only have one asic on the board
it's really not needed. Just remove it.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 1786bd7503 staging: comedi: pcmmio: remove unnecessary for () loop and sanity check
There is only one asic on the board so the for () loop in the interrupt
handler to check multiple asics is not needed.

The sanity check of the 'irq' in the interrupt handler is also not needed.
If it _is_ wrong we have bigger problems in the kernel.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 19e0bf1235 staging: comedi: pcmmio: unwind the digital i/o subdevice init
The board supported by this driver only has one asic that provides the
two digital i/o subdevices. The first dio subdevice has 24 channels that
support interrupts. The second dio subdevice also has 24 channels but no
interrupt support.

To make the code clearer and easier to maintain, remove the for () loop
that initialized these subdevices.

Also, correctly initialize the interrupt subdevice. The current code does
not set the SDF_CMD_READ subdev_flag and does not set the dev->read_subdev
pointer in the comedi_device.

Use the dev->read_subdev pointer in the interrupt handler to get the
interrupt subdevice and private data pointer instead of searching for
them. To keep this patch reviewable, the extra indents in interrupt_pcmmio()
will be removed later.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 29947fd631 staging: comedi: pcmmio: simplify pcmmio_stop_intr()
This function is only called by the interrupt subdevice so the sanity
check of the 'asic' is not necessary. Remove it.

The 'nports' is always 3 and the 'firstport' is always 0. Remove the
for () loop that clears the registers to disable the interrupts and
just use the pcmmio_dio_write() helper to write to the three page
registers.

This also fixes a bug where the write to the page registers is not
protected with the spinlock.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 62957c9867 staging: comedi: pcmmio: remove 'iobases' from the subdevice private data
This member of the subdevice private data is not longer used. Remove it.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 0398606c18 staging: comedi: pcmmio: simplify pcmmio_dio_insn_bits()
Currently this function uses the subdevice private data to get the
iobase address needed to update the dio output channel state and
read the current state of the input channels. This subdevice private
data is in the process of being removed.

Use the subdevice 'index' to determine the base 'port' needed to
access the correct digital i/o registers. The pcmmio_dio_write()
function can then be used to update the outputs.

Introduce a new helper function, pcmmio_dio_read(), to read the
current state of the input channels.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 72c7692a9d staging: comedi: pcmmio: simplify pcmmio_dio_insn_config()
Currently this function uses the subdevice private data to get the
iobase address needed to update the channel configuration. This
subdevice private data is in the process of being removed.

Use the subdevice 'index' to determine the base 'port' needed to
access the correct digital i/o registers. The pcmmio_dio_write()
function can then be used to update the configuration.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 4edac4a4da staging: comedi: pcmmio: introduce pcmmio_dio_write()
The paged registers in the asic need to be spinlock protected to
ensure that the page is not changed while writing to the registers.

Introduce a helper function to make sure the spinlock is used.

Use the new helper in pcmmio_reset(). This is one of the places where
the spinlock is not used.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 83d55bd03f staging: comedi: pcmmio: rename 'spinlock' in the private data
This spinlock_t is meant to protect the page registers in the asic.
Rename it to make this clear.

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>
2013-12-17 10:02:13 -08:00
H Hartley Sweeten 20218e6a3c staging: comedi: pcmmio: remove 'subpriv' macro
This macro relies on a local variable having a specific name. Remove
the macro and add a local variable where used.

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>
2013-12-17 10:02:12 -08:00
H Hartley Sweeten 03a36f172b staging: comedi: pcmmio: cleanup the digital i/o register defines
Redefine the registers used to access the digital i/o so that they
are based on the dev->iobase of the board instead of the 'asic_iobase'
that is stored in the private data.

Remove the then unused 'asic_iobase'.

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>
2013-12-17 10:02:12 -08:00
H Hartley Sweeten 0cc4f3bd5f staging: comedi: pcmmio: tidy up init_asics()
Rename this function so it has namespace associated with the driver.

The board supported by this driver only has one WinSystems WS16C48 asic
on it that handles the digital i/o. Remove the unnecessary for () loop
that would reset multiple asics.

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>
2013-12-17 10:02:12 -08:00
H Hartley Sweeten 8657fed873 staging: comedi: pcmmio: remove 'asic' parameter from switch_page()
The board supported by this driver only has one WinSystems WS16C48 asic
on it that handles the digital i/o.

Remove the unnecessary 'asic' parameter that is passed to switch_page().

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>
2013-12-17 10:02:12 -08:00
H Hartley Sweeten d65bd16d05 staging: comedi: pcmmio: there is only one asic
The board supported by this driver only has one WinSystems WS16C48 asic
on it that handles the digital i/o.

Remove the 'asics' struct array in the private data and add members for
the single 'asic_iobase' and the spinlock used by the asic.

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>
2013-12-17 10:02:12 -08:00
H Hartley Sweeten b16f405a6b staging: comedi: pcmmio: remove unused members in private data
The 'pol' and 'enab' members in the private data are never used. The
'num' member is set during the attach but never used. Remove them.

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>
2013-12-17 10:02:12 -08:00
H Hartley Sweeten 6e6bed0b52 staging: comedi: pcmmio: tidy up the irq request
The for () loop that does the request_irq() in this driver is a bit of
an overkill. The code appears to have been copied from the pcmuio driver
which supports boards with 1 or 2 ASIC devices. The board supported by
this driver only has 1 ASIC.

Simplify the code and store the irq number in the comedi_device. This
allows the core to automatically do the free_irq() when the driver is
detached.

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>
2013-12-17 10:02:12 -08:00
H Hartley Sweeten 5d4997bbfa staging: comedi: pcmmio: tidy up the ao subdevice init
Add some whitespace to the analog output subdevice init and reorder the
init to follow the "norm" in comedi drivers.

Remove the init of len_chanlist. This member is only used for subdevices
the support async commands. The core will default the value correctly.

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>
2013-12-17 10:01:50 -08:00