GitHub/exynos8895/android_kernel_samsung_universal8895.git
11 years agostaging/iio: (iio_hwmon) Use devm_kzalloc
Guenter Roeck [Thu, 31 Jan 2013 21:42:00 +0000 (21:42 +0000)]
staging/iio: (iio_hwmon) Use devm_kzalloc

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio:common: removed unused functions outside st_sensors library
Denis CIOCCA [Wed, 30 Jan 2013 09:15:00 +0000 (09:15 +0000)]
iio:common: removed unused functions outside st_sensors library

This patch remove st_sensors_get_sampling_frequency_avl and
st_sensors_get_scale_avl functions used only in
st_sensors_sysfs_sampling_frequency_avail and st_sensors_sysfs_scale_avail
sysfs functions.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio: gyro: Add itg3200
Manuel Stahl [Fri, 1 Feb 2013 08:51:00 +0000 (08:51 +0000)]
iio: gyro: Add itg3200

This patch adds support for the InvenSense itg3200.
The itg3200 is a three-axis gyro with 16-bit ADC and
I2C interface.

Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio: Move adxrs450 driver out of staging
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio: Move adxrs450 driver out of staging

The adxrs450 is in a reasonable shape now. It follows the IIO ABI and non of the
standard code checker tools report any issue, so move it out of staging.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Move header file contents to main file
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Move header file contents to main file

The contents of the adxrs450 header file is not used outside the main drivers
file, so just move the contents from the header file into the drivers main file.
Also rename the adxrs450 driver file from adxrs450_core.c to adxrs450.c.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Fixup kernel doc comments
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Fixup kernel doc comments

Fix the name of the iio_device parameter for a few functions and add
documentation for one missing function parameter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Use usleep_range for the sequential transfer dealy
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Use usleep_range for the sequential transfer dealy

The adxrs450 requires a delay of at least 0.1 ms between register writes.  Using
msleep() for such small delays is not recommended. So use usleep_range instead.

Fixes the following checkpatch warning:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Don't split string across multiple lines
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Don't split string across multiple lines

This is one of the exceptions to the 80 chars per line rule since breaking the
string in half it badly affects the grep-ability.

Fixes the following checkpatch warning:
WARNING: quoted string split across lines
#203: FILE: staging/iio/gyro/adxrs450_core.c:203:
+ dev_warn(&st->us->dev, "The initial power on response "
+  "is not correct! Restart without reset?\n");

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Reflow overlong lines
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Reflow overlong lines

Reflow two lines to meet the 80 characters per line limit.

Fixes the following checkpatch warnings:
WARNING: line over 80 characters
#29: FILE: staging/iio/gyro/adxrs450_core.c:29:
+ * @reg_address: the address of the lower of the two registers,which should be an even address,

WARNING: line over 80 characters
#81: FILE: staging/iio/gyro/adxrs450_core.c:81:
+ * @reg_address: the address of the lower of the two registers,which should be an even address,

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Don't spam the bootlog
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Don't spam the bootlog

Don't spam the bootlog with the devices part id and serial number.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Reject out of range calibscale values
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Reject out of range calibscale values

Instead of silently discarding the upper bits reject out of range values for the
calibscale property.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Perform sign extension for the calibbias register
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Perform sign extension for the calibbias register

The calibbias (DNC) register contains a 10-bit twos complement value. Perform a
proper sign extension when reading the register, otherwise negative will
incorrectly be displayed as large positive values.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adxrs450: Make transfer buffers __be32
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
staging:iio:adxrs450: Make transfer buffers __be32

Fixes the following sparse warnings:

drivers/staging/iio/gyro/adxrs450_core.c:46:15: warning: cast to restricted __be32
drivers/staging/iio/gyro/adxrs450_core.c:62:17: warning: cast to restricted __be32
drivers/staging/iio/gyro/adxrs450_core.c:89:15: warning: cast to restricted __be32
drivers/staging/iio/gyro/adxrs450_core.c:129:17: warning: cast to restricted __be32
drivers/staging/iio/gyro/adxrs450_core.c:168:16: warning: cast to restricted __be32

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoPartially revert "staging:iio:gyro:adxrs450 make more use of spi_read and spi_write."
Lars-Peter Clausen [Thu, 31 Jan 2013 14:27:00 +0000 (14:27 +0000)]
Partially revert "staging:iio:gyro:adxrs450 make more use of spi_read and spi_write."

This partially reverts commit cb4496876f03631eff913b3c608c964d48d61eb9. There is
no apparent reason why we should split a transaction which consists out of
multiple transfers into multiple transactions each having one transfer. While
this works it introduces a bunch of unnecessary context switch and additional
setup costs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio: Remove noop call to __iio_update_buffer
Lars-Peter Clausen [Mon, 28 Jan 2013 10:12:00 +0000 (10:12 +0000)]
staging:iio: Remove noop call to __iio_update_buffer

__iio_update_buffer updates the buffer's bytes_per_datum and length fields.
But the only user of this function just passes in these exact fields, so the
call basically looks like this:

buffer->bytes_per_datum = buffer->bytes_per_datum;
buffer->length = buffer->length;

Which means it is a noop and can be removed. Also remove the function itself,
since it is now unused.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio:magnetometer: Add STMicroelectronics magnetometers driver
Denis Ciocca [Fri, 25 Jan 2013 23:44:00 +0000 (23:44 +0000)]
iio:magnetometer: Add STMicroelectronics magnetometers driver

This patch adds a generic magnetometer driver for STMicroelectronics
magnetometers, currently it supports:
LSM303DLHC, LSM303DLM, LIS3MDL.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio:gyro: Add STMicroelectronics gyroscopes driver
Denis Ciocca [Fri, 25 Jan 2013 23:44:00 +0000 (23:44 +0000)]
iio:gyro: Add STMicroelectronics gyroscopes driver

This patch adds a generic gyroscope driver for STMicroelectronics
gyroscopes, currently it supports:
L3G4200D, LSM330DL, L3GD20, L3GD20H, LSM330DLC, L3G4IS, LSM330.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio:accel: Add STMicroelectronics accelerometers driver
Denis Ciocca [Fri, 25 Jan 2013 23:44:00 +0000 (23:44 +0000)]
iio:accel: Add STMicroelectronics accelerometers driver

This patch adds a generic accelerometer driver for STMicroelectronics
accelerometers, currently it supports:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio:common: Add STMicroelectronics common library
Denis Ciocca [Fri, 25 Jan 2013 23:44:00 +0000 (23:44 +0000)]
iio:common: Add STMicroelectronics common library

This patch add a generic library for STMicroelectronics 3-axis sensors.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: comedi: don't expose comedi_proc_{init,cleanup}
H Hartley Sweeten [Wed, 30 Jan 2013 22:25:31 +0000 (15:25 -0700)]
staging: comedi: don't expose comedi_proc_{init,cleanup}

These functions are only used by the comedi core. Move the
prototypes to comedi_internal.h so they are not exposed to
the comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: don't expose comedi_device_{attach,detach}
H Hartley Sweeten [Wed, 30 Jan 2013 22:25:06 +0000 (15:25 -0700)]
staging: comedi: don't expose comedi_device_{attach,detach}

These functions are only used by the comedi core. Move the
prototypes to comedi_internal.h so they are not exposed to
the comedi drivers.

Tidy up comedi_internal.h a bit so that all the internal stuff
in drivers.c is grouped.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: tidy up the general purpose driver functions
H Hartley Sweeten [Wed, 30 Jan 2013 22:24:38 +0000 (15:24 -0700)]
staging: comedi: tidy up the general purpose driver functions

Group all the general comedi driver register/config/attach
prototypes into one place in comedidev.h.

Reorder the functions in drivers.c a bit so they are in a more
logical usage order (bottom to top).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_daq_700: convert to auto attach
H Hartley Sweeten [Wed, 30 Jan 2013 22:24:13 +0000 (15:24 -0700)]
staging: comedi: ni_daq_700: convert to auto attach

Convert this pcmcia driver to the comedi auto attach mechanism.

This allows getting rid of the "hack" needed to pass the pcmcia_device
pointer from the pcmcia_driver to the comedi_driver.

We can also get rid of the boardinfo since it was only used to
provide the "name" that was used with the manual attach.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das08_cs: convert to auto attach
H Hartley Sweeten [Wed, 30 Jan 2013 22:23:50 +0000 (15:23 -0700)]
staging: comedi: das08_cs: convert to auto attach

Convert this pcmcia driver to the comedi auto attach mechanism.

This allows getting rid of the "hack" needed to pass the pcmcia_device
pointer from the pcmcia_driver to the comedi_driver.

We still need the boardinfo because the das08 driver uses it. But we
can get rid of the duplicate that allowed attaching with the driver
name.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: cb_das16_cs: convert to auto attach
H Hartley Sweeten [Wed, 30 Jan 2013 22:23:27 +0000 (15:23 -0700)]
staging: comedi: cb_das16_cs: convert to auto attach

Convert this pcmcia driver to the comedi auto attach mechanism.

This allows getting rid of the "hack" needed to pass the pcmcia_device
pointer from the pcmcia_driver to the comedi_driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: allow pcmcia drivers to auto attach
H Hartley Sweeten [Wed, 30 Jan 2013 22:23:06 +0000 (15:23 -0700)]
staging: comedi: allow pcmcia drivers to auto attach

Introduce some helper functions to allow converting the comedi
pcmcia drivers to the comedi auto_attach mechanism.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: conditionally build in PCMCIA driver support
H Hartley Sweeten [Wed, 30 Jan 2013 22:22:44 +0000 (15:22 -0700)]
staging: comedi: conditionally build in PCMCIA driver support

Separate the comedi_pcmcia_* functions out of drivers.c into a new
source file, comedi_pcmcia.c. This allows conditionally building
support for comedi pcmcia drivers into the comedi core without the
need for the #if'defery. Fix the Kconfig and Makefile appropriately.

Group all the comedi_pcmcia_* prototypes into one place in comedidev.h.
Protect these prototypes with an #ifdef so that building a comedi
pcmcia driver without PCMCIA support will cause a build error. This
will normally not happen as long as the comedi pcmcia driver is placed
in the proper group in the Kconfig.

Remove the #include <pcmcia/*.h> from drivers.c. These includes are only
needed by the comedi pcmcia driver support code and the pcmcia drivers.
The include should occur in those files.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: conditionally build in PCI driver support
H Hartley Sweeten [Wed, 30 Jan 2013 22:22:21 +0000 (15:22 -0700)]
staging: comedi: conditionally build in PCI driver support

Separate the comedi_pci_* functions out of drivers.c into a new
source file, comedi_pci.c. This allows conditionally building
support for comedi PCI drivers into the comedi core. Fix the
Kconfig and Makefile appropriately.

Group all the comedi_pci_* prototypes and related defines into one
place in comedidev.h. Protect these prototypes with an #ifdef and
provide some dummy functions so that the mixed ISA/PCI comedi
drivers will still build correctly.

Remove the #include <linux/pci.h> from comedidev.h and drivers.c. This
include is only needed by the comedi PCI driver support code and the
PCI drivers. The include should occur in those files.

Also, remove the #include <linux/pci.h> from a couple non-PCI drivers
since it's not needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: conditionally build in USB driver support
H Hartley Sweeten [Wed, 30 Jan 2013 22:21:49 +0000 (15:21 -0700)]
staging: comedi: conditionally build in USB driver support

Separate the comedi_usb_* functions out of drivers.c into a new
source file, comedi_usb.c. This allows conditionally building
support for comedi USB drivers into the comedi core without the
need for the #if'defery. Fix the Kconfig and Makefile appropriately.
For aesthetic reasons, add some whitespace to the Makefile to keep
everything lined up.

Group all the comedi_usb_* prototypes into one place in comedidev.h.
Protect these prototypes with an #ifdef so that building a comedi
usb driver without USB support will cause a build error. This will
normally not happen as long as the comedi USB driver is placed in
the proper group in the Kconfig.

Remove the #include<linux/usb.h> from comedidev.h and drivers.c. This
include is only needed by the comedi USB driver support code and the
USB drivers. The include should occur in those files.

Removing the include of usb.h exposed a couple drivers that need
<linux/interrupt.h> and <linux/sched.h>. Add the missing includes.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: Fix URB submitted while active warning.
Malcolm Priestley [Wed, 30 Jan 2013 20:07:29 +0000 (20:07 +0000)]
staging: vt6656: Fix URB submitted while active warning.

This error happens because PIPEnsControlOut and PIPEnsControlIn unlock the
spin lock for delay, letting in another thread.

The patch moves the current MP_SET_FLAG to before filling
of sUsbCtlRequest for pControlURB and clears it in event of failing.

Any thread calling either function while fMP_CONTROL_READS or fMP_CONTROL_WRITES
flags set will return STATUS_FAILURE.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: stable@vger.kernel.org # 3.8
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Fix compiler warning
Peter Hurley [Wed, 30 Jan 2013 21:18:50 +0000 (16:18 -0500)]
staging/fwserial: Fix compiler warning

Fix:
drivers/staging/fwserial/fwserial.c:581:3: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t'

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Annotate rcu pointers with __rcu
Peter Hurley [Wed, 30 Jan 2013 22:44:16 +0000 (17:44 -0500)]
staging/fwserial: Annotate rcu pointers with __rcu

Fixes these sparse warnings:
drivers/staging/fwserial/fwserial.c:430:16: sparse: incompatible types in comparison expression (different address spaces)
drivers/staging/fwserial/fwserial.c:699:30: sparse: incompatible types in comparison expression (different address spaces)
drivers/staging/fwserial/fwserial.c:802:16: sparse: incompatible types in comparison expression (different address spaces)
drivers/staging/fwserial/fwserial.c:898:16: sparse: incompatible types in comparison expression (different address spaces)
drivers/staging/fwserial/fwserial.c:1842:14: sparse: incompatible types in comparison expression (different address spaces)

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: zsmalloc: remove unused pool name
Seth Jennings [Wed, 30 Jan 2013 15:36:52 +0000 (09:36 -0600)]
staging: zsmalloc: remove unused pool name

zs_create_pool() currently takes a name argument which is
never used in any useful way.

This patch removes it.

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ISA DMA drivers should depend on ISA_DMA_API
Geert Uytterhoeven [Wed, 30 Jan 2013 12:00:09 +0000 (13:00 +0100)]
staging: comedi: ISA DMA drivers should depend on ISA_DMA_API

m68k allmodconfig:

  CC [M]  drivers/staging/comedi/drivers/pcl812.o
drivers/staging/comedi/drivers/pcl812.c: In function â€˜pcl812_ai_cmd’:
drivers/staging/comedi/drivers/pcl812.c:736: error: implicit declaration of function â€˜set_dma_mode’
drivers/staging/comedi/drivers/pcl812.c:736: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/pcl812.c:736: error: (Each undeclared identifier is reported only once
drivers/staging/comedi/drivers/pcl812.c:736: error: for each function it appears in.)
drivers/staging/comedi/drivers/pcl812.c:737: error: implicit declaration of function â€˜claim_dma_lock’
drivers/staging/comedi/drivers/pcl812.c:738: error: implicit declaration of function â€˜clear_dma_ff’
drivers/staging/comedi/drivers/pcl812.c:739: error: implicit declaration of function â€˜set_dma_addr’
drivers/staging/comedi/drivers/pcl812.c:740: error: implicit declaration of function â€˜set_dma_count’
drivers/staging/comedi/drivers/pcl812.c:741: error: implicit declaration of function â€˜release_dma_lock’
drivers/staging/comedi/drivers/pcl812.c:742: error: implicit declaration of function â€˜enable_dma’
drivers/staging/comedi/drivers/pcl812.c: In function â€˜interrupt_pcl812_ai_dma’:
drivers/staging/comedi/drivers/pcl812.c:883: error: implicit declaration of function â€˜disable_dma’
drivers/staging/comedi/drivers/pcl812.c:884: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/pcl812.c: In function â€˜pcl812_ai_poll’:
drivers/staging/comedi/drivers/pcl812.c:947: error: implicit declaration of function â€˜get_dma_residue’
make[2]: *** [drivers/staging/comedi/drivers/pcl812.o] Error 1
  CC [M]  drivers/staging/comedi/drivers/pcl816.o
drivers/staging/comedi/drivers/pcl816.c: In function â€˜interrupt_pcl816_ai_mode13_dma’:
drivers/staging/comedi/drivers/pcl816.c:359: error: implicit declaration of function â€˜disable_dma’
drivers/staging/comedi/drivers/pcl816.c:366: error: implicit declaration of function â€˜set_dma_mode’
drivers/staging/comedi/drivers/pcl816.c:366: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/pcl816.c:366: error: (Each undeclared identifier is reported only once
drivers/staging/comedi/drivers/pcl816.c:366: error: for each function it appears in.)
drivers/staging/comedi/drivers/pcl816.c:367: error: implicit declaration of function â€˜claim_dma_lock’
drivers/staging/comedi/drivers/pcl816.c:369: error: implicit declaration of function â€˜set_dma_addr’
drivers/staging/comedi/drivers/pcl816.c:372: error: implicit declaration of function â€˜set_dma_count’
drivers/staging/comedi/drivers/pcl816.c:378: error: implicit declaration of function â€˜release_dma_lock’
drivers/staging/comedi/drivers/pcl816.c:379: error: implicit declaration of function â€˜enable_dma’
drivers/staging/comedi/drivers/pcl816.c: In function â€˜pcl816_ai_cmd’:
drivers/staging/comedi/drivers/pcl816.c:629: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/pcl816.c:631: error: implicit declaration of function â€˜clear_dma_ff’
drivers/staging/comedi/drivers/pcl816.c: In function â€˜pcl816_ai_poll’:
drivers/staging/comedi/drivers/pcl816.c:679: error: implicit declaration of function â€˜get_dma_residue’
make[2]: *** [drivers/staging/comedi/drivers/pcl816.o] Error 1
  CC [M]  drivers/staging/comedi/drivers/pcl818.o
drivers/staging/comedi/drivers/pcl818.c: In function â€˜interrupt_pcl818_ai_mode13_dma’:
drivers/staging/comedi/drivers/pcl818.c:547: error: implicit declaration of function â€˜disable_dma’
drivers/staging/comedi/drivers/pcl818.c:550: error: implicit declaration of function â€˜set_dma_mode’
drivers/staging/comedi/drivers/pcl818.c:550: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/pcl818.c:550: error: (Each undeclared identifier is reported only once
drivers/staging/comedi/drivers/pcl818.c:550: error: for each function it appears in.)
drivers/staging/comedi/drivers/pcl818.c:551: error: implicit declaration of function â€˜claim_dma_lock’
drivers/staging/comedi/drivers/pcl818.c:552: error: implicit declaration of function â€˜set_dma_addr’
drivers/staging/comedi/drivers/pcl818.c:555: error: implicit declaration of function â€˜set_dma_count’
drivers/staging/comedi/drivers/pcl818.c:561: error: implicit declaration of function â€˜release_dma_lock’
drivers/staging/comedi/drivers/pcl818.c:562: error: implicit declaration of function â€˜enable_dma’
drivers/staging/comedi/drivers/pcl818.c: In function â€˜pcl818_ai_mode13dma_int’:
drivers/staging/comedi/drivers/pcl818.c:886: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/pcl818.c:888: error: implicit declaration of function â€˜clear_dma_ff’
make[2]: *** [drivers/staging/comedi/drivers/pcl818.o] Error 1
  CC [M]  drivers/staging/comedi/drivers/das16.o
drivers/staging/comedi/drivers/das16.c: In function â€˜das16_cmd_exec’:
drivers/staging/comedi/drivers/das16.c:644: error: implicit declaration of function â€˜claim_dma_lock’
drivers/staging/comedi/drivers/das16.c:645: error: implicit declaration of function â€˜disable_dma’
drivers/staging/comedi/drivers/das16.c:648: error: implicit declaration of function â€˜clear_dma_ff’
drivers/staging/comedi/drivers/das16.c:650: error: implicit declaration of function â€˜set_dma_addr’
drivers/staging/comedi/drivers/das16.c:654: error: implicit declaration of function â€˜set_dma_count’
drivers/staging/comedi/drivers/das16.c:655: error: implicit declaration of function â€˜enable_dma’
drivers/staging/comedi/drivers/das16.c:656: error: implicit declaration of function â€˜release_dma_lock’
drivers/staging/comedi/drivers/das16.c: In function â€˜disable_dma_on_even’:
drivers/staging/comedi/drivers/das16.c:845: error: implicit declaration of function â€˜get_dma_residue’
drivers/staging/comedi/drivers/das16.c: In function â€˜das16_attach’:
drivers/staging/comedi/drivers/das16.c:1197: error: implicit declaration of function â€˜set_dma_mode’
drivers/staging/comedi/drivers/das16.c:1197: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/das16.c:1197: error: (Each undeclared identifier is reported only once
drivers/staging/comedi/drivers/das16.c:1197: error: for each function it appears in.)
make[2]: *** [drivers/staging/comedi/drivers/das16.o] Error 1
  CC [M]  drivers/staging/comedi/drivers/das1800.o
drivers/staging/comedi/drivers/das1800.c: In function â€˜das1800_flush_dma_channel’:
drivers/staging/comedi/drivers/das1800.c:555: error: implicit declaration of function â€˜disable_dma’
drivers/staging/comedi/drivers/das1800.c:559: error: implicit declaration of function â€˜clear_dma_ff’
drivers/staging/comedi/drivers/das1800.c:562: error: implicit declaration of function â€˜get_dma_residue’
drivers/staging/comedi/drivers/das1800.c: In function â€˜das1800_flush_dma’:
drivers/staging/comedi/drivers/das1800.c:586: error: implicit declaration of function â€˜claim_dma_lock’
drivers/staging/comedi/drivers/das1800.c:603: error: implicit declaration of function â€˜release_dma_lock’
drivers/staging/comedi/drivers/das1800.c: In function â€˜das1800_handle_dma’:
drivers/staging/comedi/drivers/das1800.c:622: error: implicit declaration of function â€˜set_dma_addr’
drivers/staging/comedi/drivers/das1800.c:624: error: implicit declaration of function â€˜set_dma_count’
drivers/staging/comedi/drivers/das1800.c:625: error: implicit declaration of function â€˜enable_dma’
drivers/staging/comedi/drivers/das1800.c: In function â€˜das1800_init_dma’:
drivers/staging/comedi/drivers/das1800.c:1424: error: implicit declaration of function â€˜set_dma_mode’
drivers/staging/comedi/drivers/das1800.c:1424: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/das1800.c:1424: error: (Each undeclared identifier is reported only once
drivers/staging/comedi/drivers/das1800.c:1424: error: for each function it appears in.)
make[2]: *** [drivers/staging/comedi/drivers/das1800.o] Error 1
  CC [M]  drivers/staging/comedi/drivers/dt282x.o
drivers/staging/comedi/drivers/dt282x.c: In function â€˜dt282x_ao_dma_interrupt’:
drivers/staging/comedi/drivers/dt282x.c:328: error: implicit declaration of function â€˜disable_dma’
drivers/staging/comedi/drivers/dt282x.c: In function â€˜prep_ai_dma’:
drivers/staging/comedi/drivers/dt282x.c:416: error: implicit declaration of function â€˜set_dma_mode’
drivers/staging/comedi/drivers/dt282x.c:416: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/dt282x.c:416: error: (Each undeclared identifier is reported only once
drivers/staging/comedi/drivers/dt282x.c:416: error: for each function it appears in.)
drivers/staging/comedi/drivers/dt282x.c:417: error: implicit declaration of function â€˜claim_dma_lock’
drivers/staging/comedi/drivers/dt282x.c:418: error: implicit declaration of function â€˜clear_dma_ff’
drivers/staging/comedi/drivers/dt282x.c:419: error: implicit declaration of function â€˜set_dma_addr’
drivers/staging/comedi/drivers/dt282x.c:420: error: implicit declaration of function â€˜set_dma_count’
drivers/staging/comedi/drivers/dt282x.c:421: error: implicit declaration of function â€˜release_dma_lock’
drivers/staging/comedi/drivers/dt282x.c:423: error: implicit declaration of function â€˜enable_dma’
drivers/staging/comedi/drivers/dt282x.c: In function â€˜prep_ao_dma’:
drivers/staging/comedi/drivers/dt282x.c:439: error: â€˜DMA_MODE_WRITE’ undeclared (first use in this function)
drivers/staging/comedi/drivers/dt282x.c: In function â€˜dt282x_interrupt’:
drivers/staging/comedi/drivers/dt282x.c:471: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/dt282x.c: In function â€˜dt282x_ai_cmd’:
drivers/staging/comedi/drivers/dt282x.c:690: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/dt282x.c: In function â€˜dt282x_ao_cmd’:
drivers/staging/comedi/drivers/dt282x.c:938: error: â€˜DMA_MODE_WRITE’ undeclared (first use in this function)
make[2]: *** [drivers/staging/comedi/drivers/dt282x.o] Error 1
  CC [M]  drivers/staging/comedi/drivers/ni_at_a2150.o
drivers/staging/comedi/drivers/ni_at_a2150.c: In function â€˜a2150_interrupt’:
drivers/staging/comedi/drivers/ni_at_a2150.c:237: error: implicit declaration of function â€˜claim_dma_lock’
drivers/staging/comedi/drivers/ni_at_a2150.c:238: error: implicit declaration of function â€˜disable_dma’
drivers/staging/comedi/drivers/ni_at_a2150.c:241: error: implicit declaration of function â€˜clear_dma_ff’
drivers/staging/comedi/drivers/ni_at_a2150.c:249: error: implicit declaration of function â€˜get_dma_residue’
drivers/staging/comedi/drivers/ni_at_a2150.c:286: error: implicit declaration of function â€˜set_dma_addr’
drivers/staging/comedi/drivers/ni_at_a2150.c:287: error: implicit declaration of function â€˜set_dma_count’
drivers/staging/comedi/drivers/ni_at_a2150.c:288: error: implicit declaration of function â€˜enable_dma’
drivers/staging/comedi/drivers/ni_at_a2150.c:290: error: implicit declaration of function â€˜release_dma_lock’
drivers/staging/comedi/drivers/ni_at_a2150.c: In function â€˜a2150_attach’:
drivers/staging/comedi/drivers/ni_at_a2150.c:794: error: implicit declaration of function â€˜set_dma_mode’
drivers/staging/comedi/drivers/ni_at_a2150.c:794: error: â€˜DMA_MODE_READ’ undeclared (first use in this function)
drivers/staging/comedi/drivers/ni_at_a2150.c:794: error: (Each undeclared identifier is reported only once
drivers/staging/comedi/drivers/ni_at_a2150.c:794: error: for each function it appears in.)
make[2]: *** [drivers/staging/comedi/drivers/ni_at_a2150.o] Error 1

Make PCL816, PCL818, DAS16, DAS1800, DT282X, and NI_AT_A2150 depend on
ISA_DMA_API to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: cleanup all board minors on module exit
Ian Abbott [Mon, 28 Jan 2013 17:07:39 +0000 (17:07 +0000)]
staging: comedi: cleanup all board minors on module exit

The comedi core module optionally allocates some legacy board minor
devices on module load and cleans these up on module exit.  These are
used for manual configuration of comedi boards (for those low-level
comedi drivers that support manual configuration - mainly for ISA
boards).  Other board minor devices are created and destroyed
dynamically in response to bus device probe and remove requests.  The
ioctl used for manual configuration (attachment) and removal
(detachment) of devices is COMEDI_DEVCONFIG, but that works for any
board minor device, including those that were originally created
dynamically.

If the COMEDI_DEVCONFIG ioctl is used to manually detach an
automatically created and attached device, commit
7d3135af399e92cf4c9bbc5f86b6c140aab3b88c ("staging: comedi: prevent
auto-unconfig of manually configured devices") ensures that the board
minor will no longer be automatically detached and destroyed by a bus
device remove request.  From that point on the board minor behaves more
like one of the comedi "legacy" board minors.  (There would be some
justification for destroying the board minor instead, but I'd rather
leave that decision until removal of board minors has been
made safer than it currently is.)  Although the board minor behaves more
like a legacy board minor, it is not currently cleaned up on module
exit.  In fact, the module exit code will bug out because this board
minor has not been cleaned up.

Change comedi_cleanup_legacy_minors() (called from the module exit code,
and from the module init code on error) to clean up all board minors.
Rename the function to comedi_cleanup_board_minors() to reflect the
change in functionality.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: disallow COMEDI_DEVCONFIG on non-board minors
Ian Abbott [Mon, 28 Jan 2013 16:14:31 +0000 (16:14 +0000)]
staging: comedi: disallow COMEDI_DEVCONFIG on non-board minors

Comedi has two sorts of minor devices:
(a) normal board minor devices in the range 0 to
COMEDI_NUM_BOARD_MINORS-1 inclusive; and
(b) special subdevice minor devices in the range COMEDI_NUM_BOARD_MINORS
upwards that are used to open the same underlying comedi device as the
normal board minor devices, but with non-default read and write
subdevices for asynchronous commands.

The special subdevice minor devices get created when a board supporting
asynchronous commands is attached to a normal board minor device, and
destroyed when the board is detached from the normal board minor device.
One way to attach or detach a board is by using the COMEDI_DEVCONFIG
ioctl.  This should only be used on normal board minors as the special
subdevice minors are too ephemeral.  In particular, the change
introduced in commit 7d3135af399e92cf4c9bbc5f86b6c140aab3b88c ("staging:
comedi: prevent auto-unconfig of manually configured devices") breaks
horribly for special subdevice minor devices.

Since there's no legitimate use for the COMEDI_DEVCONFIG ioctl on a
special subdevice minor device node, disallow it and return -ENOTTY.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Fix endian issue in unit directory
Peter Hurley [Tue, 29 Jan 2013 14:10:30 +0000 (09:10 -0500)]
staging/fwserial: Fix endian issue in unit directory

Reported-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: add diagnostic for buffer overflow
Peter Hurley [Tue, 29 Jan 2013 03:34:43 +0000 (22:34 -0500)]
staging/fwserial: add diagnostic for buffer overflow

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Remove reference to removed constant
Peter Hurley [Tue, 29 Jan 2013 03:34:42 +0000 (22:34 -0500)]
staging/fwserial: Remove reference to removed constant

FWSERIAL_TTY_START_MINOR was removed. The minor_start is allocated
by tty_alloc_driver().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Don't use deprecated alloc_tty_driver()
Peter Hurley [Tue, 29 Jan 2013 03:34:41 +0000 (22:34 -0500)]
staging/fwserial: Don't use deprecated alloc_tty_driver()

Use tty_alloc_driver() instead.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Factor unstable stats/debug/status info to debugfs
Peter Hurley [Tue, 29 Jan 2013 03:34:40 +0000 (22:34 -0500)]
staging/fwserial: Factor unstable stats/debug/status info to debugfs

Add the following file hierarchy to debugfs:

  <debugfs>-+
            +- firewire_serial -+- <unit> -+- peers
                                |          +- stats
                                |
                                +- <unit> -+- peers
                                           +- stats

The 'peers' file (read-only) contains status and configuration
info for attached peers for the given fwserial unit.

The 'stats' file (read-only) contains statistics and data profiling
information for each tty port for the given fwserial unit.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Cleanup /proc/tty/driver/ file
Peter Hurley [Tue, 29 Jan 2013 03:34:39 +0000 (22:34 -0500)]
staging/fwserial: Cleanup /proc/tty/driver/ file

Factor out extra stats, data profiles, debugging info and peer info
from procfs file in preparation for using debugfs instead.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Create loop device the 'tty' way
Peter Hurley [Tue, 29 Jan 2013 03:34:38 +0000 (22:34 -0500)]
staging/fwserial: Create loop device the 'tty' way

Register a second tty driver to create loopback devices for
each firewire node. Note that the loopback devices are numbered
from 0; the tty->index is transformed when used to index the
port table.

Remove the hack that previously enabled this.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Fix sparse build warnings
Peter Hurley [Tue, 29 Jan 2013 03:34:37 +0000 (22:34 -0500)]
staging/fwserial: Fix sparse build warnings

Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Release port regardless of unplug response code
Peter Hurley [Tue, 29 Jan 2013 03:34:36 +0000 (22:34 -0500)]
staging/fwserial: Release port regardless of unplug response code

After sending the unplug response, release the port even if an
error occurred.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Only reset port status for attached peers
Peter Hurley [Tue, 29 Jan 2013 03:34:35 +0000 (22:34 -0500)]
staging/fwserial: Only reset port status for attached peers

When a port has been reserved in an attempt to connect to a peer
but that attempt does not succeed, releasing the port should not
reset the port line status. Although resetting is functionally
harmless, it can appear as if a remote peer dropped carrier to a
port it was not attached to (which can be confusing).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Drop suggestion for helper fn integration
Peter Hurley [Tue, 29 Jan 2013 01:57:49 +0000 (20:57 -0500)]
staging/fwserial: Drop suggestion for helper fn integration

The firewire core does not require or want the suggested helper fns;
drop suggestion from TODO file.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Assume firmware is OHCI-complaint
Peter Hurley [Tue, 29 Jan 2013 01:57:48 +0000 (20:57 -0500)]
staging/fwserial: Assume firmware is OHCI-complaint

Devices which are OHCI v1.0/ v1.1/ v1.2-draft compliant or
RFC 2734 compliant are required by specification to support
max_rec of 8 (512 bytes) or more. Accept reported value.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Fold constant MAX_ASYNC_PAYLOAD
Peter Hurley [Tue, 29 Jan 2013 01:57:47 +0000 (20:57 -0500)]
staging/fwserial: Fold constant MAX_ASYNC_PAYLOAD

Since peer->max_payload is now limited to 1394-2008 spec maximum
of 4096, the port->max_payload limit can now be simplified.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Simplify max payload calculation
Peter Hurley [Tue, 29 Jan 2013 01:57:46 +0000 (20:57 -0500)]
staging/fwserial: Simplify max payload calculation

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Refer to fw_device as "node"
Peter Hurley [Tue, 29 Jan 2013 01:57:45 +0000 (20:57 -0500)]
staging/fwserial: Refer to fw_device as "node"

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Remove bandwidth limit logic
Peter Hurley [Tue, 29 Jan 2013 01:57:44 +0000 (20:57 -0500)]
staging/fwserial: Remove bandwidth limit logic

Self-limiting asynchronous bandwidth (via reducing the payload)
is not necessary and does not work, because
 1) asynchronous traffic will absorb all available bandwidth (less that
    being used for isochronous traffic)
 2) isochronous arbitration always wins.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging:ozwpan: Fix following warning.
Rupesh Gujare [Tue, 29 Jan 2013 17:00:55 +0000 (17:00 +0000)]
staging:ozwpan: Fix following warning.

The patch ae926051d7eb: "staging: ozwpan: Added USB HCD
implementation" from Feb 20, 2012, leads to the following warning:
drivers/staging/ozwpan/ozhcd.c:1094 oz_hcd_heartbeat()
 warn: what is this condition about? 'ep->buffered_units * 50'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: cleanup the string mess
Marc Dietrich [Sun, 27 Jan 2013 16:43:43 +0000 (17:43 +0100)]
staging: nvec: cleanup the string mess

Replace the various command strings by named constants.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: fix mouse suspend/resume calls
Marc Dietrich [Sun, 27 Jan 2013 16:43:42 +0000 (17:43 +0100)]
staging: nvec: fix mouse suspend/resume calls

The EC command for enable/disable is not an EC command. Instead it needs
to be send to the mouse.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: move toggle global event reporting to its own function
Marc Dietrich [Sun, 27 Jan 2013 16:43:41 +0000 (17:43 +0100)]
staging: nvec: move toggle global event reporting to its own function

Cleanup toggle of global event reporting by moving it to its own function.
This simplifies the following cleanup.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: zsmalloc: Fix TLB coherency and build problem
Minchan Kim [Mon, 28 Jan 2013 01:00:08 +0000 (10:00 +0900)]
staging: zsmalloc: Fix TLB coherency and build problem

Recently, Matt Sealey reported he fail to build zsmalloc caused by
using of local_flush_tlb_kernel_range which are architecture dependent
function so !CONFIG_SMP in ARM couldn't implement it so it ends up
build error following as.

  MODPOST 216 modules
  LZMA    arch/arm/boot/compressed/piggy.lzma
  AS      arch/arm/boot/compressed/lib1funcs.o
ERROR: "v7wbi_flush_kern_tlb_range"
[drivers/staging/zsmalloc/zsmalloc.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
make: *** Waiting for unfinished jobs....

The reason we used that function is copy method by [1]
was really slow in ARM but at that time.

More severe problem is ARM can prefetch speculatively on other CPUs
so under us, other TLBs can have an entry only if we do flush local
CPU. Russell King pointed that. Thanks!
We don't have many choices except using flush_tlb_kernel_range.

My experiment in ARMv7 processor 4 core didn't make any difference with
zsmapbench[2] between local_flush_tlb_kernel_range and flush_tlb_kernel_range
but still page-table based is much better than copy-based.

* bigger is better.

1. local_flush_tlb_kernel_range: 3918795 mappings
2. flush_tlb_kernel_range : 3989538 mappings
3. copy-based: 635158 mappings

This patch replace local_flush_tlb_kernel_range with
flush_tlb_kernel_range which are avaialbe in all architectures
because we already have used it in vmalloc allocator which are
generic one so build problem should go away and performane loss
shoud be void.

[1] f553646, zsmalloc: add page table mapping method
[2] https://github.com/spartacus06/zsmapbench

Cc: stable@vger.kernel.org
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Reported-by: Matt Sealey <matt@genesi-usa.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/omapdrm: Use kmemdup rather than duplicating its implementation
Peter Huewe [Fri, 25 Jan 2013 23:40:13 +0000 (00:40 +0100)]
staging/omapdrm: Use kmemdup rather than duplicating its implementation

Found with coccicheck.
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: zcache: remove unnecessary braces in zcache-main.c
Ryo Munakata [Sat, 26 Jan 2013 10:50:53 +0000 (19:50 +0900)]
Staging: zcache: remove unnecessary braces in zcache-main.c

This fixes a checkpatch.pl issue of
'braces {} are not necessary for single statement blocks'

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/csr: Use kmemdup rather than duplicating its implementation
Peter Huewe [Fri, 25 Jan 2013 23:19:19 +0000 (00:19 +0100)]
staging/csr: Use kmemdup rather than duplicating its implementation

Found with coccicheck.
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE
Seth Jennings [Fri, 25 Jan 2013 17:46:18 +0000 (11:46 -0600)]
staging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE

Right now ZS_SIZE_CLASS_DELTA is hardcoded to be 16.  This
creates 254 classes for systems with 4k pages. However, on
PPC64 with 64k pages, it creates 4095 classes which is far
too many.

This patch makes ZS_SIZE_CLASS_DELTA relative to PAGE_SIZE
so that regardless of the page size, there will be the same
number of classes.

Acked-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/comedi/adl_pci8164: Don't assign string
Peter Huewe [Mon, 28 Jan 2013 23:36:39 +0000 (00:36 +0100)]
staging/comedi/adl_pci8164: Don't assign string

Assigning a string is really bad,
and since we only have 1 char strings here we
can simply use a char to store the value and change the format specifier.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: simplify comedi_set_hw_dev()
Ian Abbott [Tue, 29 Jan 2013 16:20:17 +0000 (16:20 +0000)]
staging: comedi: simplify comedi_set_hw_dev()

Since `get_device()` and `put_device()` can take a NULL device
parameter, `comedi_set_hw_dev()` can be simplified to always call
`get_device()` for the new, possibly NULL hardware device, and
`put_device()` for the old, possibly NULL hardware device.  As long as
we do it in that order, there shouldn't be any problem with
`kref_release()` getting called unexpectedly when the new hardware
device is the old hardware device.

Simplify `comedi_set_hw_dev()` and update the comment because the
function is used for additional purposes since the old comment was
written.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: don't override read/write subdevice if not supported
Ian Abbott [Tue, 29 Jan 2013 14:05:58 +0000 (14:05 +0000)]
staging: comedi: don't override read/write subdevice if not supported

For comedi devices that support asynchronous commands on some of their
subdevices, the comedi core creates extra device files for each of those
subdevices of the form "/dev/comedi%i_subd%i".  These use the same
comedi device as the corresponding "/dev/comedi%i" but override the
default "read" and "write" subdevice for the device.  Currently it
overrides both the read and write subdevice, but it only makes sense to
override the "read" subdevice if the subdevice supports "read" commands,
and to override the "write" subdevice if the subdevice supports "write"
commands.

In `comedi_alloc_subdevice_minor()`, only set `info->read_subdevice`
non-NULL if the subdevice has the `SDF_CMD_READ` flag set, and only set
`info->write_subdevice` non-NULL if the subdevice has the
`SDF_CMD_WRITE` flag set.  (`comedi_read_subdevice(info)` will use the
device's default read subdevice if `info->read_subdevice` is NULL.
`comedi_write_subdevice(info)` will use the device's default write
subdevice if `info->write_subdevice` is NULL.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: remove '#undef LABPC_DEBUG'
H Hartley Sweeten [Sat, 26 Jan 2013 01:38:23 +0000 (18:38 -0700)]
staging: comedi: ni_labpc_cs: remove '#undef LABPC_DEBUG'

The LABPC_DEBUG define is not used in any of the code. Just
remove the #undef.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: cleanup the boardinfo declaration
H Hartley Sweeten [Sat, 26 Jan 2013 01:38:04 +0000 (18:38 -0700)]
staging: comedi: ni_labpc_cs: cleanup the boardinfo declaration

For aesthetic reasons, reformat the boardinfo declaration and
add some whitespace. Remove all the information that is set to
'0' as this is the default.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: remove thisboard macro
H Hartley Sweeten [Sat, 26 Jan 2013 01:37:41 +0000 (18:37 -0700)]
staging: comedi: ni_labpc_cs: remove thisboard macro

The 'thisboard' macro relies on a local variable having a specific
name and yields a pointer derived from that local variable.

Replace the macro with a local variable and use the comedi_board()
helper to get the pointer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: move comedi_driver declaration
H Hartley Sweeten [Sat, 26 Jan 2013 01:37:27 +0000 (18:37 -0700)]
staging: comedi: ni_labpc_cs: move comedi_driver declaration

Move the comedi_driver declaration down in the file. This removes
the need for the forward declaration.

For aesthetic reasons, add some whitespace to the declaration and
remove the unnecessary '&' before the function names. They are
already addresses.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: remove pcmcia_device private data
H Hartley Sweeten [Sat, 26 Jan 2013 01:37:06 +0000 (18:37 -0700)]
staging: comedi: ni_labpc_cs: remove pcmcia_device private data

The private data, struct local_info_t, is not being used in the
driver. Remove it as well as the kzalloc/kfree.

Also, don't set the 'pcmcia_cur_dev' variable unless the pcmcia
configuration is successful.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: cleanup labpc_cs_attach()
H Hartley Sweeten [Sat, 26 Jan 2013 01:36:50 +0000 (18:36 -0700)]
staging: comedi: ni_labpc_cs: cleanup labpc_cs_attach()

Absorb the code from labpc_config() into this function and properly
return the error if the configuration fails.

Also, remove the dev_dbg() function trace message.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: move pcmcia_driver functions
H Hartley Sweeten [Sat, 26 Jan 2013 01:36:33 +0000 (18:36 -0700)]
staging: comedi: ni_labpc_cs: move pcmcia_driver functions

For aesthetic reasons, move all the pcmcia_driver functions so they
are near the pcmcia_driver declaration. This also removes the need
for some of the forward declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: remove pcmcia_driver suspend/resume
H Hartley Sweeten [Sat, 26 Jan 2013 01:36:16 +0000 (18:36 -0700)]
staging: comedi: ni_labpc_cs: remove pcmcia_driver suspend/resume

The pcmcia_driver suspend and resume functions in this driver
don't do anything. Since they are optional just remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: remove 'stop' from private pcmcia data
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:55 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_cs: remove 'stop' from private pcmcia data

The pcmcia_driver suspend and remove functions set the 'stop' variable
and the resume function clears it. Nothing in the comedi_driver code
uses the 'stop' variable.

Just remove it so we can get rid of the suspend/resume.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: remove labpc_release()
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:39 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_cs: remove labpc_release()

The function simply calls pcmcia_disable_device(). Remove it and
just call pcmcia_disable_device() where needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: cleanup pcmcia_driver
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:22 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_cs: cleanup pcmcia_driver

For aesthetic reasons, reorder the pcmcia_driver variables and
add some whitespace.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: move MODULE_* info to end of file
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:06 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_cs: move MODULE_* info to end of file

For aesthetic reasons, move all the MODULE_* information to the end
of the file.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: cleanup the boardinfo declaration
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:55 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: cleanup the boardinfo declaration

For aesthetic reasons, reformat the boardinfo declaration and
add some whitespace. Remove all the information that is set to
'0' as this is the default.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: cleanup mio_cs_attach()
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:37 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: cleanup mio_cs_attach()

Remove the DPRINTK() function trace message as well as the #if 0'ed
out debug code that dumps the board "fingerprint".

Remove the need for the local variable that holds the link->irq
passed to request_irq(). Also, return the error code from that
function instead of assuming -EINVAL. Use the dev->board_name for
the resource string passed to request_irq() instead of the open
coded string "ni_mio_cs".

For aesthetic reasons, add some whitespace to the initializatio
of the devpriv values.

Just return the result of ni_E_init() instead of checking it for
an error, returning the error, or returning "0".

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: remove last forward declaration
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:19 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: remove last forward declaration

Move the ni_getboardtype() function to remove the last forward
declaration in this file.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: move mio_cs_detach()
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:02 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: move mio_cs_detach()

For aesthetic reasons, move this function down so it's by the
comedi_driver declaration.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: move comedi_driver declaration
H Hartley Sweeten [Sat, 26 Jan 2013 00:34:45 +0000 (17:34 -0700)]
staging: comedi: ni_mio_cs: move comedi_driver declaration

Move the comedi_driver declaration down in the file. This gets
rid of the need for a couple forward declarations.

For aesthetic reasons, add some whitespace to the declaration.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: cleanup cs_attach()
H Hartley Sweeten [Sat, 26 Jan 2013 00:34:27 +0000 (17:34 -0700)]
staging: comedi: ni_mio_cs: cleanup cs_attach()

Absorb the code from mio_cs_config() into this function and
properly return the error if the configuration fails.

Remove the DPRINTK() function trace message.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: remove cs_release()
H Hartley Sweeten [Sat, 26 Jan 2013 00:34:10 +0000 (17:34 -0700)]
staging: comedi: ni_mio_cs: remove cs_release()

This function simply calls pcmcia_disable_device(). Remove it and
just call pcmcia_disable_device() where needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: move pcmcia_driver functions
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:54 +0000 (17:33 -0700)]
staging: comedi: ni_mio_cs: move pcmcia_driver functions

For aesthetic reasons, move all the pcmcia_driver functions so they
are near the pcmcia_driver declaration. This also removes the need
for a couple forward declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: remove pcmcia_driver suspend/resume
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:37 +0000 (17:33 -0700)]
staging: comedi: ni_mio_cs: remove pcmcia_driver suspend/resume

The pcmcia_driver suspend and resume functions in this driver
don't do anything. Since they are optional just remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: remove setting dev->driver
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:17 +0000 (17:33 -0700)]
staging: comedi: ni_mio_cs: remove setting dev->driver

The comedi core sets the dev->driver pointer before calling the
comedi_driver attach function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: cleanup pcmcia_driver
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:00 +0000 (17:33 -0700)]
staging: comedi: ni_mio_cs: cleanup pcmcia_driver

For aesthetic reasons, reorder the pcmcia_driver variables and
add some whitespace.

Also, remove the unnecessary '&' before the function names. They
are already addresses.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_mio_cs: move MODULE_* info to end of file
H Hartley Sweeten [Sat, 26 Jan 2013 00:32:42 +0000 (17:32 -0700)]
staging: comedi: ni_mio_cs: move MODULE_* info to end of file

For aesthetic reasons, move all the MODULE_* information to the end
of the file.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: cleanup subdevice init
H Hartley Sweeten [Fri, 25 Jan 2013 22:02:28 +0000 (15:02 -0700)]
staging: comedi: quatech_daqp_cs: cleanup subdevice init

Remove the dev_info() board attach noise.

For aesthetic reasons, add some whitespace to the subdevice init.

Remove the init of the s->len_chanlist for the subdevices that do
not support commands. It's not used by them and the comedi core
will handle initializing it properly in the postconfig.

Change the return after a successful attach to "0". The comedi
core expects a < 0 value to indicate an error and "0" is the
typical value returned to indicate success.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: fix possible memory dereference issue
H Hartley Sweeten [Fri, 25 Jan 2013 22:02:06 +0000 (15:02 -0700)]
staging: comedi: quatech_daqp_cs: fix possible memory dereference issue

In daqp_attach(), the first options value passed in the comedi_devconfig
is used as an index to the private dev_table[] in this driver. This table
is used to pass the pcmcia_device to the comedi_driver.

Fix the code so that the index is checked before the table is accessed
so that we don't get a possible memory dereference BUG.

Change the error returned to the comedi core from -EIO to -ENODEV.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: cleanup the comedi_lrange tables
H Hartley Sweeten [Fri, 25 Jan 2013 22:01:46 +0000 (15:01 -0700)]
staging: comedi: quatech_daqp_cs: cleanup the comedi_lrange tables

For aesthetic reasons, cleanup the whitespace of the range_daqp_ai
table.

Remove the range_daqp_ao table and use the comedi core provided
range table for bipolar 5V (range_bipolar5).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: remove #define pr_fmt
H Hartley Sweeten [Fri, 25 Jan 2013 22:01:25 +0000 (15:01 -0700)]
staging: comedi: quatech_daqp_cs: remove #define pr_fmt

There are not pr_[level] uses in this file. Remove the pr_fmt
define.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: remove debug functions
H Hartley Sweeten [Fri, 25 Jan 2013 22:01:06 +0000 (15:01 -0700)]
staging: comedi: quatech_daqp_cs: remove debug functions

The functions daqp_dump() and hex_dump() are not used in this
driver. Just remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: simplify IRQ_NONE checks in daqp_interrupt()
H Hartley Sweeten [Fri, 25 Jan 2013 22:00:48 +0000 (15:00 -0700)]
staging: comedi: quatech_daqp_cs: simplify IRQ_NONE checks in daqp_interrupt()

Remove all the pr_warn() noise in the sanity checks that make sure
the interrupt is for this device.

Simplify the sanity checks into one if() condition.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: remove casts of void *
H Hartley Sweeten [Fri, 25 Jan 2013 22:00:22 +0000 (15:00 -0700)]
staging: comedi: quatech_daqp_cs: remove casts of void *

Casting a void * is not necessary.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: cleanup daqp_cs_attach()
H Hartley Sweeten [Fri, 25 Jan 2013 21:59:56 +0000 (14:59 -0700)]
staging: comedi: quatech_daqp_cs: cleanup daqp_cs_attach()

Absorb the code from daqp_cs_config() into this function and
properly return the error if the configuration fails.

Remove the dev_dbg() function trace messages.

Fix the kzalloc(). The preferred form for passing a size of a struct
is:

p = kzalloc(sizeof(*p), ...);

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: remove daqp_cs_release()
H Hartley Sweeten [Fri, 25 Jan 2013 21:59:36 +0000 (14:59 -0700)]
staging: comedi: quatech_daqp_cs: remove daqp_cs_release()

This function justs emits a dev_dbg() message then calls
pcmcia_disable_device(). The dev_dbg() is just added noise.

Remove the function and just call pcmcia_disable_device().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: remove forward declarations
H Hartley Sweeten [Fri, 25 Jan 2013 21:59:17 +0000 (14:59 -0700)]
staging: comedi: quatech_daqp_cs: remove forward declarations

Move some of the functions to remove the need for the forward
declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: cleanup pcmcia_driver
H Hartley Sweeten [Fri, 25 Jan 2013 21:58:58 +0000 (14:58 -0700)]
staging: comedi: quatech_daqp_cs: cleanup pcmcia_driver

For aesthetic reasons, reorder the pcmcia_driver variables and
add some whitespace.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: quatech_daqp_cs: move MODULE_* info to end of file
H Hartley Sweeten [Fri, 25 Jan 2013 21:58:36 +0000 (14:58 -0700)]
staging: comedi: quatech_daqp_cs: move MODULE_* info to end of file

For aesthetic reasons, move all the MODULE_* information to the end
of the file.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>