Re: [PATCH 8/8] staging: dgap: fix memory leak in dgap_parsefile()

2014-07-14 Thread Dan Carpenter
On Tue, Jul 15, 2014 at 12:05:14PM +0900, Daeseok Youn wrote: > The p->u.board.status is allocated and set a string as > "No" once within allocating a node of BNODE type. > But it also set again with kstrdup() in case of "STATUS" > or "ID". If it is not allocated yet, use kstrdup(). > If not, use j

Re: [PATCH 6/8] staging: dgap: remove unneeded dgap_err()

2014-07-14 Thread Dan Carpenter
On Tue, Jul 15, 2014 at 12:02:23PM +0900, Daeseok Youn wrote: > The dgap_err() is printing a message with pr_err(), > so all those are replaced. > Take a look at how pr_fmt works. #define pr_fmt(fmt) "dgap: " fmt Then you can remove the "dgap: " from the beginning of each line. Also all the "o

Re: [PATCH 7/8] staging: dgap: introduce dgap_cleanup_nodes()

2014-07-14 Thread Dan Carpenter
On Tue, Jul 15, 2014 at 12:04:02PM +0900, Daeseok Youn wrote: > When a configration file is parsed with dgap_parsefile(), > makes nodes for saving configrations for board. > > Making a node will allocate node memory and strings for saving > configrations with kstrdup(). > > So these are freed whe

Re: [PATCH v4] staging: android: Clean up else statement from binder_send_failed_reply

2014-07-14 Thread Dan Carpenter
On Mon, Jul 14, 2014 at 04:38:43PM -0300, Lucas Tanure wrote: > Hi, > > This patch got accepted ? > It looks ok. You will get an automated email when the patch is merged into Greg's tree. It can take 2 weeks or longer depending on merge window timing or Greg's travel schedule. Anyway, your pat

Re: [BISECTED][REGRESSION] Loading Hyper-V network drivers is racy in 3.14+ on Hyper-V 2012 R2

2014-07-14 Thread Sitsofe Wheeler
On Mon, Jul 14, 2014 at 10:39:48PM +, Haiyang Zhang wrote: > > -Original Message- > > From: Sitsofe Wheeler [mailto:sits...@gmail.com] > > Sent: Monday, July 14, 2014 5:31 PM > > To: Haiyang Zhang > > Cc: KY Srinivasan; David S. Miller; de...@linuxdriverproject.org; linux- > > ker...@vg

Re: [PATCH 2/2] staging: comedi: addi_apci_1564: use addi_watchdog module to init watchdog subdevice

2014-07-14 Thread Chase Southwood
On Mon, Jul 14, 2014 at 4:22 AM, Ian Abbott wrote: > On 2014-07-12 23:44, Chase Southwood wrote: >> >> Use the addi_watchdog module to provide support for the watchdog >> subdevice. >> >> Also, rearrange the subdevice init blocks so that the order makes sense. >> Digital input/output subdevices an

[PATCH] staging: rtl8192ee: Fix setting highest n rate

2014-07-14 Thread Larry Finger
Commit 4fb6a37c3f94c1cb4b828bfcc4347771e1628f88 by Andrey Utkin and entitled "staging: rtl8192ee: "Correct bitmask in comparsion" fixed what appeared to be a typo. After consultation with the Realtek engineers, merely testing for a 2T2R device is sufficient to ensure that the TX MCS map will equal

Re: [PATCH v2] drivers: staging: lustre: Use 'force_die' instead of 'die' to avoid compiling issue

2014-07-14 Thread Chen Gang
在 2014年7月15日,上午9:40,Greg Kroah-Hartman 写道: > On Mon, Jul 14, 2014 at 08:04:15PM +0800, Chen Gang wrote: >> >> For drivers/staging/lustre/lustre/include/lustre_sec.h:391: >> >> - staging tree: use '\t ' between 'die' and '('. >> >> - linux-next tree: use ' ' between 'die' and '('. >> >> S

[PATCH] staging: android: Clean up else statement from sync_fence_poll()

2014-07-14 Thread Lucas Tanure
Kernel coding style. Remove useless else statement after return. Signed-off-by: Lucas Tanure --- drivers/staging/android/sync.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index c9a0c2c..e7b2e02 100644 ---

[PATCH 93/93] Staging: comedi: adl_pci9118: fixed style issues

2014-07-14 Thread sam-the-6
From: Sam Asadi several style issues fixed. Signed-off-by: Sam Asadi modified: drivers/staging/comedi/drivers/adl_pci9118.c --- drivers/staging/comedi/drivers/adl_pci9118.c | 124 +- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/drivers/sta

[PATCH 92/93] Staging: comedi: 8255: fixed by adding an empthy line

2014-07-14 Thread sam-the-6
From: Sam Asadi fixed a coding style issue. Signed-off-by: Sam Asadi modified: drivers/staging/comedi/drivers/8255.c --- drivers/staging/comedi/drivers/8255.c | 150 - 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/drivers/staging/com

[PATCH 91/93] Staging: comedi: 8253.h fixed by removing 'return' from generic func

2014-07-14 Thread sam-the-6
From: Sam Asadi Signed-off-by: Sam Asadi modified: drivers/staging/comedi/drivers/8253.h --- drivers/staging/comedi/drivers/8253.h |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/8253.h b/drivers/staging/comedi/drivers/8253.h i

[PATCH 8/8] staging: dgap: fix memory leak in dgap_parsefile()

2014-07-14 Thread Daeseok Youn
The p->u.board.status is allocated and set a string as "No" once within allocating a node of BNODE type. But it also set again with kstrdup() in case of "STATUS" or "ID". If it is not allocated yet, use kstrdup(). If not, use just memcpy(). Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dg

[PATCH 7/8] staging: dgap: introduce dgap_cleanup_nodes()

2014-07-14 Thread Daeseok Youn
When a configration file is parsed with dgap_parsefile(), makes nodes for saving configrations for board. Making a node will allocate node memory and strings for saving configrations with kstrdup(). So these are freed when dgap is unloaded or failed to initialize. Signed-off-by: Daeseok Youn --

[PATCH 6/8] staging: dgap: remove unneeded dgap_err()

2014-07-14 Thread Daeseok Youn
The dgap_err() is printing a message with pr_err(), so all those are replaced. Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c | 226 -- 1 files changed, 108 insertions(+), 118 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/s

[PATCH 5/8] staging: dgap: remove dgap_newnode()

2014-07-14 Thread Daeseok Youn
The dgap_newnode() is useless for creating new node. So just use kzalloc and set a type in case statement. Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c | 104 ++ 1 files changed, 74 insertions(+), 30 deletions(-) diff --git a/drivers/stagi

[PATCH 4/8] staging: dgap: remove unused a parameter in dgap_gettok()

2014-07-14 Thread Daeseok Youn
The "p" as parameter is unused. Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 17514c8..1e52092 100644 --- a/drivers/staging/dgap/dgap.c ++

[PATCH 3/8] staging: dgap: fix a typo in dgap_gettok()

2014-07-14 Thread Daeseok Youn
The "boar" should be "board". Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 470ae7b..17514c8 100644 --- a/drivers/staging/dgap/dgap.c +++ b/driv

[PATCH 2/8] staging: dgap: remove unused case value in dgap_parsefile()

2014-07-14 Thread Daeseok Youn
If rc is zero, this function will returns with an error and cannot reach switch-case statement. Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index

[PATCH 1/8] staging: dgap: remove redundant error value check

2014-07-14 Thread Daeseok Youn
The retval in dgap_block_til_ready() is initialized to zero, and if no error has occurred in this function, the retval has a zero. So it doesn't need to check "retval" itself. Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c |5 + 1 files changed, 1 insertions(+), 4 deletions(

Re: [PATCH v2] drivers: staging: lustre: Use 'force_die' instead of 'die' to avoid compiling issue

2014-07-14 Thread Greg Kroah-Hartman
On Mon, Jul 14, 2014 at 08:04:15PM +0800, Chen Gang wrote: > > For drivers/staging/lustre/lustre/include/lustre_sec.h:391: > > - staging tree: use '\t ' between 'die' and '('. > > - linux-next tree: use ' ' between 'die' and '('. > > So the patch made under linux-next tree, can not apply

Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-14 Thread Chen Gang
On 07/15/2014 08:53 AM, Guenter Roeck wrote: > On 07/14/2014 05:34 PM, Chen Gang wrote: >> On 07/14/2014 05:22 PM, Chen Gang wrote: >>> >>> 在 2014年7月14日,下午4:57,Richard Weinberger 写道: >>> Am 14.07.2014 10:48, schrieb Lars-Peter Clausen: > On 07/14/2014 10:31 AM, Richard Weinberger wrote:

Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-14 Thread Guenter Roeck
On 07/14/2014 05:34 PM, Chen Gang wrote: On 07/14/2014 05:22 PM, Chen Gang wrote: 在 2014年7月14日,下午4:57,Richard Weinberger 写道: Am 14.07.2014 10:48, schrieb Lars-Peter Clausen: On 07/14/2014 10:31 AM, Richard Weinberger wrote: Am 13.07.2014 22:17, schrieb Greg Kroah-Hartman: On Sun, Jul 13,

Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-14 Thread Chen Gang
On 07/14/2014 05:22 PM, Chen Gang wrote: > > 在 2014年7月14日,下午4:57,Richard Weinberger 写道: > >> Am 14.07.2014 10:48, schrieb Lars-Peter Clausen: >>> On 07/14/2014 10:31 AM, Richard Weinberger wrote: Am 13.07.2014 22:17, schrieb Greg Kroah-Hartman: > On Sun, Jul 13, 2014 at 09:33:38PM +0200

Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-14 Thread Chen Gang
On 07/14/2014 05:22 PM, Chen Gang wrote: > > 在 2014年7月14日,下午4:57,Richard Weinberger 写道: > >> Am 14.07.2014 10:48, schrieb Lars-Peter Clausen: >>> On 07/14/2014 10:31 AM, Richard Weinberger wrote: Am 13.07.2014 22:17, schrieb Greg Kroah-Hartman: > On Sun, Jul 13, 2014 at 09:33:38PM +0200

[PATCH 15/15] staging: comedi: ni_daq_700: update the comedi driver comment

2014-07-14 Thread H Hartley Sweeten
Update the comment block that comedilib uses to automatically generate documentation so that it matches the drivers new functionality. Remove the Version information. The git history provides better information. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- driver

[PATCH 07/15] staging: comedi: ni_daq_700: tidy up the remaining register defines

2014-07-14 Thread H Hartley Sweeten
For aesthetics, rename these register defines to give them namespace associated with the driver and define the bits in the registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_daq_700.c | 18 +- 1 file changed,

[PATCH 13/15] staging: comedi: ni_daq_700: add ai async command support

2014-07-14 Thread H Hartley Sweeten
Add support for async commands with the Analog Input subdevice. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/Kconfig | 1 + drivers/staging/comedi/drivers/ni_daq_700.c | 401 ++-- 2 files changed, 385 i

[PATCH 05/15] staging: comedi: ni_daq_700: tidy up the command register defines

2014-07-14 Thread H Hartley Sweeten
For aesthetics, rename these register defines to give them namespace associated with the driver and define the bits in the registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_daq_700.c | 37 +++-- 1 fil

[PATCH 06/15] staging: comedi: ni_daq_700: tidy up the status register defines

2014-07-14 Thread H Hartley Sweeten
For aesthetics, rename these register defines to give them namespace associated with the driver and define the bits in the registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_daq_700.c | 26 +++--- 1 file c

[PATCH 09/15] staging: comedi: ni_daq_700: tidy up daq700_ai_rinsn()

2014-07-14 Thread H Hartley Sweeten
For aesthetics, rename this function to follow the norm for (*insn_read) operations. Refactor the code to use a common local variable to set the channel mode/range and read the A/D samples. Use the comedi_offset_munge() helper to munge the 2's complement values from the hardware to the offset bin

[PATCH 10/15] staging: comedi: ni_daq_700: tidy up daq700_ai_config()

2014-07-14 Thread H Hartley Sweeten
According to the programming manual, the writes in this function are required to initialize the DAQCard-700 hardware. For aesthetics, rename this function to clarify this. Remove the unused comedi_subdevice parameter. The programming manual also says that '0x34' should be written to the counter m

[PATCH 14/15] staging: comedi: ni_daq_700: add a counter subdevice

2014-07-14 Thread H Hartley Sweeten
The DAQ700Card has an 8254 counter/timer that provides 3 counters. Counter 0 controls the onboard data acquisition timing, and all three counters are available for general-purpose timing functions. Add a subdevice to allow the user to use the counters. Signed-off-by: H Hartley Sweeten Cc: Ian Ab

[PATCH 08/15] staging: comedi: ni_daq_700: flush A/D FIFO on conversion failure

2014-07-14 Thread H Hartley Sweeten
According to the manual, the A/D FIFO needs to be reset and cleared after a conversion failure. For aesthetics, factor the code that does this out of daq700_ai_config() and use the new helper function when a conversion times out. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Ha

[PATCH 04/15] staging: comedi: ni_daq_700: tidy up daq700_dio_insn_bits()

2014-07-14 Thread H Hartley Sweeten
This board has 8 digital output and 8 digital input channels. For convienence all 16 channels are packed into one DIO subdevice. Add a comment to clarify this. Tidy up the 'mask' check used when updating the digital outputs. For aesthetics, rename the digital output and digital input registers.

[PATCH 00/15] staging: comedi: ni_daq_700: tidy up and add async cmd support

2014-07-14 Thread H Hartley Sweeten
Tidy up this driver a bit and add support for async commands using the Analog Input subdevice. H Hartley Sweeten (15): staging: comedi: ni_daq_700: remove unnecessary enable and flush of ADC staging: comedi: ni_daq_700: use 8253.h helpers for timer operations staging: comedi: ni_daq_700: fix

[PATCH 01/15] staging: comedi: ni_daq_700: remove unnecessary enable and flush of ADC

2014-07-14 Thread H Hartley Sweeten
The ADC conversions are enabled and the FIFO is flushed by daq700_ai_config() when the driver is initially attached. There is no reason to repeat the ADC enable and flush the FIFO before each sample read in the (*insn_read). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman

[PATCH 11/15] staging: comedi: ni_daq_700: tidy up the subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some white space to the subdevice init and tidy it up a bit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_daq_700.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dri

[PATCH 03/15] staging: comedi: ni_daq_700: fix daq700_dio_insn_config()

2014-07-14 Thread H Hartley Sweeten
This board has 8 digital output and 8 digital input channels. The direction of these channels is not configurable. For convienence all 16 channels are packed into one DIO subdevice. The (*insn_config) for this subdevice currently uses the comedi core provided comedi_dio_insn_config() function to h

[PATCH 02/15] staging: comedi: ni_daq_700: use 8253.h helpers for timer operations

2014-07-14 Thread H Hartley Sweeten
Clarify the timer operations by using the helper functions in 8253.h. For aesthetics, factor the "ai start conversion" code out of daq700_ai_rinsn(). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_daq_700.c | 35 +++

[PATCH 12/15] staging: comedi: ni_daq_700: introduce daq700_ai_set_chanspec()

2014-07-14 Thread H Hartley Sweeten
In preperation for adding async command support, introduce a helper function to set chan/range/aref information when reading an analog input sample. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_daq_700.c | 40 +

RE: [BISECTED][REGRESSION] Loading Hyper-V network drivers is racy in 3.14+ on Hyper-V 2012 R2

2014-07-14 Thread Haiyang Zhang
> -Original Message- > From: Sitsofe Wheeler [mailto:sits...@gmail.com] > Sent: Monday, July 14, 2014 5:31 PM > To: Haiyang Zhang > Cc: KY Srinivasan; David S. Miller; de...@linuxdriverproject.org; linux- > ker...@vger.kernel.org; net...@vger.kernel.org > Subject: Re: [BISECTED][REGRESSION]

Re: [BISECTED][REGRESSION] Loading Hyper-V network drivers is racy in 3.14+ on Hyper-V 2012 R2

2014-07-14 Thread Sitsofe Wheeler
On Fri, Jul 11, 2014 at 03:25:11PM +, Haiyang Zhang wrote: > > > -Original Message- > > From: Sitsofe Wheeler [mailto:sits...@gmail.com] > > Sent: Friday, July 11, 2014 1:53 AM > > To: Haiyang Zhang > > Cc: KY Srinivasan; David S. Miller; de...@linuxdriverproject.org; linux- > > ker...

Re: [PATCH v4] staging: android: Clean up else statement from binder_send_failed_reply

2014-07-14 Thread Lucas Tanure
Hi, This patch got accepted ? Thanks -- Lucas Tanure +55 (19) 988176559 On Sun, Jul 13, 2014 at 9:31 PM, Lucas Tanure wrote: > Kernel coding style. Remove useless else statement after return. > Changes from v1 and v2: Fix warning for mixed declarations and code. > Declaration of "struct binder

[PATCH 16/28] staging: comedi: ni_stc.h: refactor 'aobits' boardinfo

2014-07-14 Thread H Hartley Sweeten
For aesthetics, change the 'aobits' in the boardinfo to 'ao_maxdata' to remove the need for the calculation of the subdevice 'maxdata'. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_atmio.c | 14 ++-- drivers/staging/comedi/dr

[PATCH 15/28] staging: comedi: ni_stc.h: refactor 'adbits' boardinfo

2014-07-14 Thread H Hartley Sweeten
For aesthetics, change the 'adbits' in the boardinfo to 'ai_maxdata' to remove the need for the calculation of the subdevice 'maxdata'. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_atmio.c | 16 ++--- drivers/staging/comedi/d

[PATCH 14/28] staging: comedi: ni_mio_common: remove unnecessary use of 'board->adbits'

2014-07-14 Thread H Hartley Sweeten
For aesthetics, use the subdevice 'maxdata' instead of the board 'adbits'. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/sta

[PATCH 17/28] staging: comedi: ni_mio_common: (*cancel) only works with async cmd support

2014-07-14 Thread H Hartley Sweeten
The comedi subdevice (*cancel) function can only be called by the core if the subdevice supports async commands. Move the initialization of this callback to it is only set if async commands are enabled. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/

[PATCH 10/28] staging: comedi: ni_mio_common: remove some unnecessary boardinfo access

2014-07-14 Thread H Hartley Sweeten
Currently ni_m_series_ao_config_chanlist() gets the boardinfo pointer in order to get the number of analog output channels. Get this from the comedi_subdevice instead. The ni_old_ao_config_chanlist() function also gets the boardinfo pointer to get the analog output resolution, 'aobits', in order t

[PATCH 01/28] staging: comedi: mite.h: tidy up the mite channel register offsets

2014-07-14 Thread H Hartley Sweeten
Convert the inline MITE_* functions, used to calculate the mite channel register offsets, into simple macros. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/mite.h | 106 ++ 1 file changed, 18 insertions

[PATCH 11/28] staging: comedi: ni_mio_common: merge analog output (*insn_write) functions

2014-07-14 Thread H Hartley Sweeten
Currently the PCI6xxx boards use a different (*insn_write) function for the analog output subdevice. Most of the code is identical to the (*insn_write) used by all the other board types. For aesthetics, merge the two (*insn_write) functions and handle the 'is_6xxx' differences in the common code.

[PATCH 07/28] staging: comedi: ni_stc.h: add some 'is_{board type}' flags to private data

2014-07-14 Thread H Hartley Sweeten
The board->reg_type if checked quite often in the ni_mio_common.c code to handle differences in the PCI devices supported by the ni_pcimio driver. Simplify the code a bit by adding some 'is_{board type}' bit-field flags to the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Gre

[PATCH 23/28] staging: comedi: ni_mio_common: only reset the ai/ao subdevices if they exist

2014-07-14 Thread H Hartley Sweeten
So of the boards supported by this driver do not have analog inputs and some don't have analog outputs. Move the calls that reset these subdevices during the (*attach) by ni_E_init() so they only happen if the subdevices are present. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah

[PATCH 24/28] staging: comedi: ni_mio_common: tidy up the calibration subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice init. Refactor the code so that the common parts of the subdevice are initialized in one place. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 30 +

[PATCH 27/28] staging: comedi: ni_mio_common: tidy up the gpct counter subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice init and tidy it up a bit. Unfortunately we can't get rid of the '#ifdef PCIDMA' here yet due to other ifdefery in this file. For now just add the correct test so that the async command support is not hooked up unless we have an IRQ and DMA. Si

[PATCH 26/28] staging: comedi: ni_mio_common: tidy up the PFI subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice init and tidy it up a bit. Remove the need for the extra local variable. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 34 +- 1 file chang

[PATCH 20/28] staging: comedi: ni_mio_common: refactor 'num_p0_dio_channels' boardinfo

2014-07-14 Thread H Hartley Sweeten
All of the board supported by this driver have at least 8 Digital I/O channels. A couple of the PCI boards in ni_pcimio have 32 channels. For aesthetics, change this member of the boardinfo into a bit-field flag, 'has_32dio_chan', and use that when initializing the DIO subdevice to set the number

[PATCH 28/28] staging: comedi: ni_mio_common: tidy up the frequency output subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice init. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/comedi/drive

[PATCH 03/28] staging: comedi: ni_stc.h: remove 'ao_unipolar' flag from ni_board_struct

2014-07-14 Thread H Hartley Sweeten
This member of the boardinfo for the NI MIO drivers is used to indicate if the ranges for the analog output subdevice (ao_range_table in the boardinfo) includes any unipolar ranges. If it's not set, the ao_range_table only has bipolar ranges. The 'ao_unipolar' flag is checked when munging the ao d

[PATCH 18/28] staging: comedi: ni_mio_common: tidy up the Analog Input subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the Analog Input subdevice init. The callers of ni_E_init() do the request_irq() and set dev->irq if the interrupt is available. Only hook up the async command support if we have the irq. Also, remove the '#ifdef PCIDMA' here. The ni_pcimio driver is the onl

[PATCH 08/28] staging: comedi: ni_mio_common: tidy up ni_ao_munge()

2014-07-14 Thread H Hartley Sweeten
Use the bytes_per_sample() helper instead of 'sizeof(short)' to clarify the length calculation. Use comedi_offset_munge() to handle the unsigned to two's complement munge of the data for bipolar ranges. Tidy up the local variables. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah

[PATCH 00/28] staging: comedi: ni_mio_common: more cleanup

2014-07-14 Thread H Hartley Sweeten
The ni_mio_common.c file is included by a number of National Instruments drivers to provide the "common" driver support. This series does some more cleanup to get the file closer to being changed into a module instead of including it in the drivers. H Hartley Sweeten (28): staging: comedi: mite.

[PATCH 19/28] staging: comedi: ni_mio_common: tidy up the Analog Output subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the Analog Output subdevice init. Also, remove the '#ifdef PCIDMA' here and only hook up the async command support if we have an irq and the board either has a fifo or DMA is supported. The ni_pcimio driver is the only place PCIDMA is defined. That driver is

[PATCH 25/28] staging: comedi: ni_mio_common: tidy up the EEPROM subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice init. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/comedi/drive

[PATCH 09/28] staging: comedi: ni_mio_common: remove INSN_CONFIG_ANALOG_TRIG support code

2014-07-14 Thread H Hartley Sweeten
None of the boardinfo that uses this code sets the 'has_analog_trig' flag so ni_ai_config_analog_trig() always returns -EINVAL. Also, the private data 'atrig_low', 'atrig_high', and 'atrig_mode' values that are set by ni_ai_config_analog_trig() are never used. Remove the incomplete INSN_CONFIG_AN

[PATCH 04/28] staging: comedi: ni_mio_common: fix ni_ao_insn_write_671x()

2014-07-14 Thread H Hartley Sweeten
Comedi (*insn_write) functions are expected to write insn->n values to the hardware. Fix this function to work like the core expects. Also, use the comedi_offset_munge() helper to convert the comedi unsigned values into the two's complement values that the hardware needs. Signed-off-by: H Hartley

[PATCH 06/28] staging: comedi: ni_mio_common: fix ni_ao_insn_write()

2014-07-14 Thread H Hartley Sweeten
Comedi (*insn_write) functions are expected to write insn->n values to the hardware. Fix this function to work like the core expects. Also, don't rely on the return value of ni_ao_comfig_chanlist() to determine if the values need converted to two's complement before writing to the hardware. Use th

[PATCH 02/28] staging: comedi: comedidev.h: introduce some 'range_is_external' helpers

2014-07-14 Thread H Hartley Sweeten
The comedi_krange includes a flags member that currently identifies the 'units' of the range (RF_UNIT) and if the range is from an internal or external source (RF_EXTERNAL). Introduce some helper functions to check if a given range is from an external source. Signed-off-by: H Hartley Sweeten Cc:

[PATCH 22/28] staging: comedi: ni_mio_common: init clock dividers early in ni_E_init()

2014-07-14 Thread H Hartley Sweeten
The init/reset of the hardware is a bit scattered in this function. For aesthetics, move the init of the clock dividers so it happens early and tidy up the code a bit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 27

[PATCH 13/28] staging: comedi: ni_mio_common: fix ni_ao_insn_read()

2014-07-14 Thread H Hartley Sweeten
The comedi core expects (*insn_read) functions to return insn->n data smaples. Fix this function to work like the core expects. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 10 +++--- 1 file changed, 7 insertion

[PATCH 12/28] staging: comedi: ni_mio_common: remove ai_continuous from private data

2014-07-14 Thread H Hartley Sweeten
This member of the private data can be determined by checking the cmd->stop_src. Do that instead and remove the member. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 8 ++-- drivers/staging/comedi/drivers/ni_stc.

[PATCH 05/28] staging: comedi: ni_mio_common: remove ao_win_out() macro

2014-07-14 Thread H Hartley Sweeten
This marco relies on a local variable having a specific name. Remove the macro and just use ni_ao_win_outw() directly. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 17 - 1 file changed, 8 insertions(

[PATCH 21/28] staging: comedi: ni_mio_common: tidy up the Digital I/O subdevice init

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the Digital I/O subdevice init. Only hook up the async command support if we have an irq. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 43 ++ 1 file ch

[PATCH V4 3/6] staging: vt6556: Remove uneeded return statements

2014-07-14 Thread Peter Senna Tschudin
This patch remove uneeded return statements reported by checkpatch and fixes the indentation of a multi-line call. Tested by compilation only. Signed-off-by: Peter Senna Tschudin --- Cahnges from V3: - Splitted the patches by change type drivers/staging/vt6656/card.c | 6 +- drivers/

[PATCH V4 4/6] staging: vt6556: Remove typedefs

2014-07-14 Thread Peter Senna Tschudin
This patch removes uneeded typedefs reported by chackpatch and removes one enum. The removed enum from card.h: typedef enum _CARD_PHY_TYPE { PHY_TYPE_AUTO = 0, PHY_TYPE_11B, PHY_TYPE_11G, PHY_TYPE_11A } CARD_PHY_TYPE, *PCARD_PHY_TYPE; The following typedefs were removed, but enums

[PATCH V4 5/6] staging: vt6556: Cleanup indentation on statements

2014-07-14 Thread Peter Senna Tschudin
Use tabs instead of spaces in a set of statements and fix lines over 80 chars. Reported by checkpatch. Tested by compilation only. Signed-off-by: Peter Senna Tschudin --- Cahnges from V3: - Splitted the patches by change type drivers/staging/vt6656/main_usb.c | 44

[PATCH V4 2/6] staging: vt6556: Remove double parentheses

2014-07-14 Thread Peter Senna Tschudin
This patch cleanup a checkpatch warning by removing double parentheses from if condition. Additionally it fixes a line over 80 chars. Tested by compilation only. Signed-off-by: Peter Senna Tschudin --- Cahnges from V3: - Splitted the patches by change type drivers/staging/vt6656/baseband.c |

[PATCH V4 1/6] staging: vt6556: Cleanup trivial coding style issues

2014-07-14 Thread Peter Senna Tschudin
This patch cleans up the following checkpatch issues: - tabs instead of spaces on the beginning of a line - use correct /* */ comment style - put { and } on the correct places - line over 80 chars - indentation style for multi-line calls / comments - space after semicolon , - new line after

[PATCH V4 6/6] staging: vt6556: Replace printk by pr_warn

2014-07-14 Thread Peter Senna Tschudin
This patch fixes a checkpatch warning by replacing printk by pr_warn. Tested by compilation only. Signed-off-by: Peter Senna Tschudin --- Cahnges from V3: - Splitted the patches by change type drivers/staging/vt6656/main_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 08/18] staging: comedi: ni_65xx: fix ni_65xx_intr_insn_config()

2014-07-14 Thread H Hartley Sweeten
Refactor this function to follow the standard (*insn_config) form. Add a sanity check of the number of data parameters (insn->n). Currently the core does not check INSN_CONFIG_CHANGE_NOTIFY. Fix the writes to the rise/fall edge enable registers. The macro expects a "port" value not the port offse

[PATCH v2 06/18] staging: comedi: ni_65xx: remove the need for the subdevice private data

2014-07-14 Thread H Hartley Sweeten
There is only one member in the subdevice private data, an unsigned value that is the 'base_port' that the subdevice uses to access the port registers. Just cast the appropriate value into s->private instead of allocating the private data for each subdevice. The casts are a bit of a nusance but it

[PATCH v2 12/18] staging: comedi: ni_65xx: clean up multi-line comments

2014-07-14 Thread H Hartley Sweeten
Clean up the multi-line comments at the beginning of the file so they follow the kernel CodingStyle. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 95 +++- 1 file changed, 57 insertions

[PATCH v2 10/18] staging: comedi: ni_65xx: tidy up the subdevice initialization

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice init. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 46 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers

[PATCH v2 09/18] staging: comedi: ni_65xx: tidy up the port<->chan conversions

2014-07-14 Thread H Hartley Sweeten
Introduce some convienence macros to handle the port to channel, channel to port, and channel mask calculations based on the 8 channels per port of the hardware. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 40 ++

[PATCH v2 01/18] staging: comedi: ni_65xx: filter interval register is 32-bit

2014-07-14 Thread H Hartley Sweeten
According to the register programming manual, the filter interval register is 32-bit. Fix the writes to this register. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 delet

[PATCH v2 15/18] staging: comedi: ni_65xx: remove 'output_bits' from private data

2014-07-14 Thread H Hartley Sweeten
Remove the need for the 'output_bits' in the private data by just reading the current state of the data port when updating the output channels in the (*insn_bits) function. Add a local variable to handle the inverting of the hardware values when the boardinfo indicates that the outputs are inverte

[PATCH v2 03/18] staging: comedi: ni_65xx: cleanup recurring register map

2014-07-14 Thread H Hartley Sweeten
Convert the inline functions used to calculate the offsets to the recurring port registers and rename them to remove the CamelCase. Define all the recurring registers. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c

[PATCH v2 13/18] staging: comedi: ni_65xx: update the MODULE_DESCRIPTION

2014-07-14 Thread H Hartley Sweeten
Update the MODULE_DESCRIPTION to better describe the driver. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_65xx.c

[PATCH v2 18/18] staging: comedi: ni_65xx: factor input filter disable out of (*auto_attach)

2014-07-14 Thread H Hartley Sweeten
For aesthetics, factor the code that disables the input filters out of ni_65xx_auto_attach(). Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 31 --- 1 file changed, 20 insertions(+), 11

[PATCH v2 02/18] staging: comedi: ni_65xx: cleanup non-recurring register map defines

2014-07-14 Thread H Hartley Sweeten
Rename the CamelCase defines used for the non-recurring registers. Define all the non-recurring registers and bits. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 99 1 file change

[PATCH v2 05/18] staging: comedi: ni_65xx: remove 'dio_direction' from private data

2014-07-14 Thread H Hartley Sweeten
The IO Select registers are readable. Remove the need for the 'dio_direction' member in the private data by just checking the register value for the INSN_CONFIG_DIO_QUERY instruction. Also, refactor the switch statement to return -EINVAL for unhandled instructions and have the (*insn_config) retur

[PATCH v2 07/18] staging: comedi: ni_65xx: hook up command support only if irq is available

2014-07-14 Thread H Hartley Sweeten
Subdevice 3 is used in this driver to provide edge detection of the input channels. Move the reset/disable of the interrupts and the request_irq() so that when subdevice 3 is setup we can conditionally hookup the async command support only if the irq is available. Also, remove the noise when the

[PATCH v2 17/18] staging: comedi: ni_65xx: fix digital output reset during attach

2014-07-14 Thread H Hartley Sweeten
During the attach of this driver, the digital output ports are all initialized to a known state. Some of the boards supported by this driver have output ports that are inverted from the comedi view of the output state. For these boards the values written to the ports needs to be inverted. Currentl

[PATCH v2 16/18] staging: comedi: ni_65xx: use the subdevice 'io_bits' to handle the 'invert_outputs'

2014-07-14 Thread H Hartley Sweeten
Some of the boards supported by this driver have output ports that are inverted from the comedi view of the output state. For these boards the read values from the output ports needs to be inverted before being modified and inverted again before being written back in the (*insn_bits) operation. Cu

[PATCH v2 04/18] staging: comedi: ni_65xx: cleanup INSN_CONFIG_FILTER handling

2014-07-14 Thread H Hartley Sweeten
The INSN_CONFIG_FILTER instruction is used to set the deglitch filter interval used to debounce the input channels. Absorb the helper function into the (*insn_config) function and refactor the code to not require the 'filter_interval' and 'filter_enable' members in the private data. Signed-off-by

[PATCH v2 14/18] staging: comedi: ni_65xx: tidy ni_65xx_intr_insn_bits() declaration

2014-07-14 Thread H Hartley Sweeten
For aesthetics, tidy up the whitespace of this function declarations to follow the form in the rest of the driver. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-

[PATCH v2 00/18] staging: comedi: ni_65xx: cleanup driver

2014-07-14 Thread H Hartley Sweeten
This series cleans up the comedi ni_65xx driver. v2: drop the patch that removed the 'invert_outputs' from the boardinfo reorder the series a bit to handle the 'invert_outputs' correctly Depends on: [PATCH 0/4] staging: comedi: remove unnecessary COMEDI_MITE dependancies H Hartley Sweete

[PATCH v2 11/18] staging: comedi: ni_65xx: tidy up the comedi_driver declaration

2014-07-14 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the comedi_driver declaration. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_65xx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/

[PATCH 3/4] staging: comedi: ni_65xx: remove COMEDI_MITE and HAS_DMA dependancy

2014-07-14 Thread H Hartley Sweeten
The mite module provides the DMA interface for the PCI MITE ASIC used on many National Instruments DAQ boards. This driver does not use DMA and only depends on the mite module to initialize the MITE ASIC. Handle the initialization localy and remove the unnecessary dependancies. Signed-off-by: H H

[PATCH 2/4] staging: comedi: ni_labpc_pci: remove COMEDI_MITE and HAS_DMA dependancy

2014-07-14 Thread H Hartley Sweeten
The mite module provides the DMA interface for the PCI MITE ASIC used on many National Instruments DAQ boards. This driver does not use DMA and only depends on the mite module to initialize the MITE ASIC. Handle the initialization localy and remove the unnecessary dependancies. Signed-off-by: H H

  1   2   >