Ben Hutchings [Wed, 20 Jun 2012 01:31:11 +0000 (02:31 +0100)]
staging: zsmalloc: Finish conversion to a separate module
ZSMALLOC is tristate, but the code has no MODULE_LICENSE and since it
depends on GPL-only symbols it cannot be loaded as a module. This in
turn breaks zram which now depends on it. I assume it's meant to be
Dual BSD/GPL like the other z-stuff.
There is also no module_exit, which will make it impossible to unload.
Add the appropriate module_init and module_exit declarations suggested
by comments.
Reported-by: Christian Ohm <chr.ohm@gmx.net>
References: http://bugs.debian.org/677273 Cc: stable@vger.kernel.org # v3.4 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ssv_dnp: remove empty private data
The private data struct 'dnp_private_data' contains no information.
Remove it and the alloc_private() call.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kevin McKinney [Wed, 20 Jun 2012 00:14:54 +0000 (20:14 -0400)]
Staging: bcm: Change conditions that check for NULL in nvm.c
This patch changes all conditions that check for NULL
from "if (variable == NULL)" or "if (NULL == variable)"
to "if (variable)" to make code more readable.
Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the usb driver probe/disconnect and comedi driver attach/
detach to follow the style of the other comedi driver types to
improve maintainability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the usb driver probe/disconnect and comedi driver attach/
detach to follow the style of the other comedi driver types to
improve maintainability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the usb driver probe/disconnect and comedi driver attach/
detach to follow the style of the other comedi driver types to
improve maintainability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the usb driver probe/disconnect and comedi driver attach/
detach to follow the style of the other comedi driver types to
improve maintainability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: vmk80xx: use module_comedi_usb_driver()
Use the module_comedi_usb_driver helper macro to initialize this
module. Rename the driver structs to follow the pattern of the
other comedi driver types and add some whitespace to improve
readability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: usbduxsigma: use module_comedi_usb_driver()
Use the module_comedi_usb_driver helper macro to initialize this
module. Rename the driver structs to follow the pattern of the
other comedi driver types and add some whitespace to improve
readability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: usbduxfast: use module_comedi_usb_driver()
Use the module_comedi_usb_driver helper macro to initialize this
module. Rename the driver structs to follow the pattern of the
other comedi driver types and add some whitespace to improve
readability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: usbdux: use module_comedi_usb_driver()
Use the module_comedi_usb_driver helper macro to initialize this
module. Rename the driver structs to follow the pattern of the
other comedi driver types and add some whitespace to improve
readability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: Kconfig: remove redundant depends on tests
The 'depends on COMEDI_ISA_DRIVERS' for COMEDI_AMPLC_DIO200_ISA is
not needed. This option is alread in an if/endif block that will
satisy the check.
The 'depends on COMEDI' for COMEDI_NI_COMMON was missed when all
the comedi options were wrapped in an if/endif block.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: Kconfig: menuconfig options should be bool
The menuconfig options to enable the various comedi driver types
should be bool not tristate. They don't directly affect the
building of the kernel, they just allow other options to be
selected.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CONFIG_COMEDI_PCI is not actually a Kconfig option. It is defined
in the comedidev.h header based on another Kconfig option being
enabled.
It is only referenced in the skel driver to conditionally compile
in the PCI support code. Use the CONFIG_COMEDI_PCI_DRIVERS Kconfig
option instead and remove the define.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CONFIG_COMEDI_PCMCIA is not actually a Kconfig option. It is
defined in the comedidev.h header based on another Kconfig
option being enbled.
Just remove it since the define is not used by any of the comedi
drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: Kconfig: fix drivers that require the 8255 driver
Many of the comedi drivers require the 8255 driver for
various subdevice support. The Makefile currently uses
CONFIG_COMEDI_PCI_DRIVERS to make sure the 8255 driver
is compiled. The Kconfig help for that option says that
it does not directly affect the kernel.
Fix this by adding 'select COMEDI_8255' to the drivers
that actually need the support.
Also, remove two cases where the drivers don't require
the 8255 support.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 19 Jun 2012 09:58:16 +0000 (10:58 +0100)]
staging: comedi: shrink comedi_compat32.h
"comedi_compat32.h" #include's <linux/compat.h>, but that is only needed
by "comedi_compat32.c" so move the #include to that file. Also,
"comedi_compat.h" doesn't really need the '#include <linux/fs.h>' just
to declare 'struct file' as it only uses it to construct a pointer to
that type. Replace that #include with an incomplete declaration of
'struct file' and move that #include into "comedi_compat32.c".
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 19 Jun 2012 09:17:46 +0000 (10:17 +0100)]
staging: comedi: remove comedi_fops.h
Move the contents of "comedi_fops.h" into "comedi_internal.h" and delete
"comedi_fops.h". It only contains a couple of external variable
declarations (and #include <linux/types.h>) and one of those isn't even
declared in "comedi_fops.c". The other one is an external declaration
of a variable used to store a module parameter and some of those are
already externally declared in "comedi_internal.h", so they can keep it
company!
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 19 Jun 2012 09:17:43 +0000 (10:17 +0100)]
staging: comedi: make class and file operations static
A couple of global variables in "comedi_fops.c" are only referenced from
that .c file and can be declared 'static'. Also remove them from
"comedi_fops.h" where they are declared 'extern'.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This consists of two modules, the driver, and a "helper" module that is
just a wrapper around common kernel functions. The wrapper module will
be removed soon, but for now it's needed.
These files were based on the csr-linux-wifi-5.0.3-oss.tar.gz package
provided by CSR and Blue Giga, and is covered under the license
specified in the LICENSE.txt file (basically dual BSD and GPLv2). The
files were flattened out of the deep directory mess they were originally
in, and a few EXPORT_SYMBOL_GPL() were added in order for everything to
link properly with the helper module setup.
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This module is used by the CSR wifi driver to "abstract" away the
OS-specific parts of core functions. It will be eventually deleted, but
for now is needed as the CSR driver relies on it.
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: comedi_compat_ioctl should be NULL not 0
When CONFIG_COMPAT is not defined, comedi_compat_ioctl should be
NULL not 0 in order to set the file_operations compat_ioctl variable
correctly.
This quiets a sparse warning about:
warning: Using plain integer as NULL pointer
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The comedi_async 'inttrig' member is a pointer to a callback
function. NULL should be used to clear it not 0.
This quiets a number of sparse warnings about:
Warning: Using plain integer as NULL pointer
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging:iio:adc:ad7298: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.
The previous code was not passing the temperature channel to iio_buffer_register
since the temperature channel can not be used in buffered mode. With the new
helper functions it is not possible to do this, instead the scan index for the
temperature channel is set to -1 which will cause iio_buffer_register to ignore
the channel. (Also While we are at it also assign the symbolic constant instead
of the raw value to the channel address for the temperature channel).
Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.
iio: Add helper function for initializing triggered buffers
Add a helper function for executing the common tasks which are usually involved
in setting up a simple software ringbuffer. It will allocate the buffer,
allocate the pollfunc and register the buffer.
iio: iio_buffer_register: Skip channels with negative scan index
It is not always the case that all channels can be used in buffered mode. This
patch allows channels, which can not be used in buffered mode, to set their scan
index to a negative number, which will cause iio_buffer_register to ignore the
channel.
staging: comedi: comedi_subdevice 'io_bits' should be an unsigned int
The 'io_bits' variable in the comedi_subdevice struct is a bitmask of
the input/output configuration of the the subdevice. It should be an
unsigned int to correctly represent this.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess: <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: fix return value for insn_bits functions
The comedi_subdevice 'insn_bits' functions return the number of data
elements used to perform the command. Most of the insn_bits functions
return an open coded '2' to indicate this. The same value is available
as 'insn->n'. Return that instead to better indicate what the return
means.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: remove unneeded sanity check in insn_bits functions
The comedi core does the sanity check to make sure that the data length
the INSN_BITS instruction is 2. There is no need for the drivers to do
this check. Remove all the sanity checks in the drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Jun 2012 15:35:54 +0000 (16:35 +0100)]
staging: comedi: usbduxsigma: use attach_usb() hook
Change the usbduxsigma driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.
Move the release of the driver's static 'start_stop_sem' semaphore in
usbduxsigma_attach() to occur a bit later for convenience, otherwise the
new usbduxsigma_attach_common() would need to be split in two. I don't
think the slight delay in releasing the semaphore matters too much; it's
only used in the USB probe and disconnect functions and when attaching
and detaching comedi devices.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Jun 2012 14:16:44 +0000 (15:16 +0100)]
staging: comedi: usbduxfast: use attach_usb() hook
Change the usbduxfast driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Jun 2012 13:05:34 +0000 (14:05 +0100)]
staging: comedi: change device used in dev_...() calls
A previous set of patches by Ravishankar Karkala Mallikarjunayya
replaced a load of printk() calls with dev_info(), dev_err(), etc.
Unfortunately, these used the 'struct device *hw_dev' member of 'struct
comedi_device') as the first parameter of these dev_...() calls, but
that pointer is usually NULL, so the kernel log messages come out a bit
wrong (they contain the phrase "(NULL device *)").
Use the 'struct device *class_dev' member of 'struct comedi_device'
instead for these dev_...() calls. It will be non-NULL and somewhat
meaningful to users. It's also consistent with those comedi drivers
that already use the class_dev member in their dev_...() calls.
Some of the messages included the format "comedi%d" with the minor
device number used for the "%d". This is now redundant as it will be
the same as the dev_name() part of the kernel log message produced by
the dev_...() calls.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: fix Kconfig for COMEDI_PCMCIA_DRIVERS
The depends on PCCARD is redundant. All of the comedi PCMCIA
drivers depend on PCMCIA which can only be enabled if PCCARD
is enabled. Remove the extra depends check.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Tested-by: Ian Abbott <abbotti@mev.co.uk> Reported-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
iio_scan_mask_match() returns NULL if the passed in scan mask is empty. This
will happen if no channel has been selected and buffer is enabled.
iio_sw_buffer_preenable() will assign NULL to indio_dev->active_scan_mask in
this case. As a result iio_update_demux() will cause a NULL pointer deref,
because it expects active_scan_mask to be non-NULL.
Since it does not make much sense to start data capture if there is no data to
capture this patch updates the code to fail gracefully in iio_scan_mask_match()
instead of crashing the kernel.
The ADIS163xx variants use a different register address for the auxiliary ADC
channel than the ADIS16400. This patch fixes them to use the correct address.
staging:iio:adis16400: Fix ADIS16334 temperature address
The channel spec for ADUS16334's temperature channel uses the address and scan
index for the Z-axis acceleration channel. This patch fixes it to use the
temperature channel address and scan index instead.
The PDEBUG macro is used to output a bunch of debug messages in the
driver. These messages might be useful when first creating the driver
but they shouldn't be in mainline. Remove it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcl812: remove PCL812_EXTDEBUG define and related code
The PCL812_EXTDEBUG define enables a bunch of function tracing debug
messages as well as a dump of the comedi_cmd info during the cmdtest.
There are better ways to do the function tracing and the cmdtest
dump shouldn't be in the driver. Just remove all of it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcl812: remove unneeded tests in pcl812_ai_cmdtest
The step 2 tests to make sure that the triggers are unique is not
needed for single source triggers. These were already trivially
validated in step 1.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcl818: remove unneeded tests in ai_cmdtest
The step 2 tests of the start_src, scan_begin_src, and scan_end_src
triggers to make sure they are unique are not needed. These triggers
all only have one source and it was trivially validated in step 1.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcl816: remove unneeded tests in pcl816_ai_cmdtest
The step 2 tests of the start_src, scan_begin_src, and scan_end_src
triggers to make sure they are unique are not needed. These triggers
all only have one source and it was trivially validated in step 1.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_atmio16d: remove the function tracing debug
These printk's are #ifdef'ed out with an undefined symbol anyway.
Just remove them.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>