staging: comedi: ni_65xx: tidy up the port<->chan conversions
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 <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_65xx: hook up command support only if irq is available
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 irq is not 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>
staging: comedi: ni_65xx: remove the need for the subdevice private data
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
removes the unnecessary allocations.
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>
staging: comedi: ni_65xx: remove 'dio_direction' from private data
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) return insn->n normally.
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>
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: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_670x: remove COMEDI_MITE and HAS_DMA dependancy
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 Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_65xx: remove COMEDI_MITE and HAS_DMA dependancy
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 Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_labpc_pci: remove COMEDI_MITE and HAS_DMA dependancy
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 Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: 8255_pci: remove include of mite.h
The mite.h header is included only to pickup the MITE_IODWBSR and WENAB defines
needed to set the data window (PCI BAR 1) when initializing the PCI MITE ASIC
on the National Instruments boards supported by this driver.
Remove the include of mite.h by adding the two defines locally in this 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>
staging: comedi: addi_apci_1564: use addi_watchdog module to init watchdog subdevice
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 and subdevices for DI/DO interrupt
support, followed by timer/counter/watchdog subdevices is the new order.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1564: driver no longer needs to include addi_common.h
This driver no longer depends on anything in addi_common.h, save for a
few headers that it was including indirectly. Remove the include of
addi_common.h and add the includes of <linux/interrupt.h>
and <linux/sched.h> directly.
KANG Yuxuan [Wed, 16 Jul 2014 02:45:01 +0000 (10:45 +0800)]
staging: emxx_udc: Fix coding style errors
Only fixing errors reported by checkpatch.pl, based on the following
rules:
1. '*' should be adjacent to the data name or function name.
2. Don't use C99-style "// ..." comments.
Signed-off-by: KANG Yuxuan <stonekyx@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The driver has been broken and disabled for several kernel versions now.
It doesn't have a maintainer anymore, and most of the people who've
worked on it have moved on. There's also still a long list of issues in
the TODO file before it can be moved out of staging. Until someone can
put in the work to make the driver work again and move it out of
staging, remove it from the kernel.
Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Cc: Omar Ramirez Luna <omar.ramirez@copitl.com> Cc: Suman Anna <s-anna@ti.com> Cc: Felipe Contreras <felipe.contreras@gmail.com> Cc: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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.
Chen Gang [Mon, 14 Jul 2014 11:59:13 +0000 (19:59 +0800)]
drivers: staging: lustre: Use 'force_die' instead of 'die' to avoid compiling issue
Some of architectures have already defined 'die' as macro, so can not
use it as declaration or definition in other modules, or it will cause
compiling issue.
So use more precise name 'force_die' (like 'wrap_bulk') instead of. And
the related error (with allmodconfig under score):
CC [M] drivers/staging/lustre/lustre/ptlrpc/sec.o
drivers/staging/lustre/lustre/ptlrpc/sec.c: In function 'sptlrpc_cli_ctx_expire':
drivers/staging/lustre/lustre/ptlrpc/sec.c:309:13: error: 'struct ptlrpc_ctx_ops' has no member named '__die'
ctx->cc_ops->die(ctx, 0);
^
drivers/staging/lustre/lustre/ptlrpc/sec.c: In function 'ctx_refresh_timeout':
drivers/staging/lustre/lustre/ptlrpc/sec.c:594:26: error: 'struct ptlrpc_ctx_ops' has no member named '__die'
req->rq_cli_ctx->cc_ops->die(req->rq_cli_ctx, 0);
^
make[5]: *** [drivers/staging/lustre/lustre/ptlrpc/sec.o] Error 1
make[4]: *** [drivers/staging/lustre/lustre/ptlrpc] Error 2
make[3]: *** [drivers/staging/lustre/lustre] Error 2
make[2]: *** [drivers/staging/lustre] Error 2
make[1]: *** [drivers/staging] Error 2
make: *** [drivers] Error 2
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 bugfixes from Ted Ts'o:
"More bug fixes for ext4 -- most importantly, a fix for a bug
introduced in 3.15 that can end up triggering a file system corruption
error after a journal replay.
It shouldn't lead to any actual data corruption, but it is scary and
can force file systems to be remounted read-only, etc"
* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: fix potential null pointer dereference in ext4_free_inode
ext4: fix a potential deadlock in __ext4_es_shrink()
ext4: revert commit which was causing fs corruption after journal replays
ext4: disable synchronous transaction batching if max_batch_time==0
ext4: clarify ext4_error message in ext4_mb_generate_buddy_error()
ext4: clarify error count warning messages
ext4: fix unjournalled bg descriptor while initializing inode bitmap
Merge tag 'iio-for-3.17c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
3rd round of IIO new drivers, cleanups and functionality for the 3.17 cycle.
New drivers
* isl29125 digital color light sensor driver
* TAOS/AMS tcs3414 digital color sensor
Staging graduation
* ad7291 ADC driver.
New functionality
* st_sensors - device tree support and bindings
* mma8452 - device tree support
Cleanups
* Drop redundant variables in a number of drivers.
* Reorder a structure definition to ealy wiht a warning about static
not being at the beginning in the hid-sensors driver.
* Switch a few more drivers away from using explicit sampling_frequency
attribute to providing this through the core.
* Make hid_sensor_get_reporting_interval static as only used within a single
file.
* Drop a redundant check for negative values in an unsigned variable from
ad9832
* Drop some duplicate case labels in the event monitor example code.
* Use devm_ioremap_resource to simplify error handling.
* Use devm_kzalloc within the blackfin timer driver to simplify error
handling and removal.
* A number of cleanups of the ad7291 from Hartmut Knaack in response
to a patch moving it out of staging.
* Core support for the period info element about events. It has been
in the abi for a while, but not added until now to the newer handling
of information related to events.
* Add HAS_IOMEM dependency to mxs_lradc to avoid build issues when testing
enabled.