1
0
Fork 0
Commit Graph

16700 Commits (c0013f6f8bbcb7605d591431444780d636dbe223)

Author SHA1 Message Date
H Hartley Sweeten 1cc8f8854c staging: comedi: vmk80xx: remove private data 'count'
The 'count' in the private data is only used in a couple dev_info()
kernel messages. These messages are just added noise.

Remove the 'count' variable in the private data as well as the
dev_info() messages.

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>
2013-02-05 18:07:10 -08:00
H Hartley Sweeten 78f8fa7f00 staging: comedi: vmk80xx: factor out usb buffer allocation
Factor the code that allocates the usb buffers out of vmk80xx_usb_probe().

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>
2013-02-05 18:07:10 -08:00
H Hartley Sweeten 49253d542c staging: comedi: vmk80xx: factor out usb endpoint detection
Factor the code that detects the usb endpoints out of vmk80xx_usb_probe().

Cleanup the detection code in the new 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>
2013-02-05 18:07:10 -08:00
H Hartley Sweeten da7b18ee8b staging: comedi: vmk80xx: consistently use the same local var names
Rename some of the local variables used in this driver to make the
code easier to maintain and understand.

s/udev/usb	the usb_device that the comedi_driver is attached to
s/dev/devpriv	the private data of the comedi_device
s/cdev/dev	the comedi_device

Also, use some local variables in a couple of the functions to tidy
up the code a bit.

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>
2013-02-05 18:07:10 -08:00
H Hartley Sweeten dc49cbfc67 staging: comedi: vmk80xx: rename struct vmk80xx_usb
The struct vmk80xx_usb is actually the private data for the
comedi_device. For aesthetic reasons, rename the struct to
vmk80xx_private.

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>
2013-02-05 18:07:10 -08:00
H Hartley Sweeten 9f4d4de308 staging: comedi: vmk80xx: remove VMK80XX_SUBD_* enum
These enum values are only used in the initialization of the
comedi_subdevices. They don't help make the code any clearer
so 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>
2013-02-05 18:07:10 -08:00
H Hartley Sweeten 70ba1a5993 staging: comedi: vmk80xx: remove common and unused boardinfo
Some of the information in the boardinfo is common for both boards
supported by this driver. Remove that information from the boardinfo
and just initialize the subdevice values directly.

Also, remove any information in the boardinfo that is not used in
the 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>
2013-02-05 18:07:09 -08:00
H Hartley Sweeten 0dd772bf76 staging: comedi: vmk80xx: save the boardinfo in the comedi_device
Save a copy of the boardinfo pointer in the comedi_device 'board_ptr'.
The subdevice functions can then simply get it using the comedi_board()
helper.

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>
2013-02-05 18:07:09 -08:00
H Hartley Sweeten 20d6007755 staging: comedi: vmk80xx: move boardinfo into a const array
The normal way of presenting the board specific information in comedi
drivers is store the data in a static const array. This data is then
accessed using a pointer, normally the comedi_device 'board_ptr',

Move the boardinfo for the two boards supported by this driver from
the vmk80xx_usb_probe() function into a static const array.

Change the access of this information so a pointer is used.

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>
2013-02-05 18:07:09 -08:00
H Hartley Sweeten ce87422743 staging: comedi: vmk80xx: use comedi_auto_unconfig() for (*disconnect)
The usb_driver (*disconnect) in this driver is simply a wrapper around
comedi_auto_unconfig(). Just use comedi_auto_unconfig() directly for
the (*disconnect).

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>
2013-02-05 18:07:09 -08:00
H Hartley Sweeten 9377b9234f staging: comedi: vmk80xx: move usb_driver (*disconnect) code
The usb_driver (*disconnect) in this driver calls the comedi core
comedi_usb_auto_unconfig() which calls the comedi_driver (*detach).

Move the code in the (*disconnect) to the (*detach) to get all the
disconnect/detach in one place.

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>
2013-02-05 18:07:09 -08:00
H Hartley Sweeten 07b502f50b staging: comedi: vmk80xx: remove support for manual attaching
This comedi USB driver supports attaching with the auto config
mechanism. Remove the manual attaching support using the
COMEDI_DEVCONFIG ioctl.

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>
2013-02-05 18:07:09 -08:00
Minchan Kim 8b3cc3edb7 zram: get rid of lockdep warning
Lockdep complains about recursive deadlock of zram->init_lock.
[1] made it false positive because we can't request IO to zram
before setting disksize. Anyway, we should shut lockdep up to
avoid many reporting from user.

[1] : zram: force disksize setting before using zram

Acked-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 18:01:24 -08:00
Minchan Kim 152bce6bdd zram: fix warning of print format
kbuild bot whinges due to print format mistmatch caused by
zram: force disksize setting before using zram.

This patch fixes it.

Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 18:01:24 -08:00
Peter Huewe c7b7cad0d8 staging/vt6656: Fix sparse warning constant 0xffffffff00000000U is so big it is unsigned long
Since 7c65fa2a4c
'staging: vt6656: Remove QWORD from source and replace with u64.'
a new sparse warning showed up:

'drivers/staging/vt6656/card.c:798:26: sparse: constant
 0xffffffff00000000U is so big it is unsigned long'

-> Append L to fix the warning.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Malcolm Priestley <tvboxspy@gmail.com>
Cc: "Justin P. Mattock" <justinmattock@gmail.com>
Cc: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 14:37:44 -08:00
Dan Carpenter f1ec57239f [media] staging: go7007: print the audio input type
Smatch complains that the "Audio input:" printk isn't reachable.  Hiding
the "return 0;" behind another statement is a style violation.
It looks like audio_input is normally configured so I've enabled the
print statement.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:20:36 -02:00
Peter Huewe 4b488afbc4 staging/xgifb: Remove always false if statement
MCLKData does not contain any 0x1C value for its field SR28 nor does
XGI340_ECLKData contain any 0x1C or 0x22 value for its field SR2E.

-> the statement always evaluates to false.
-> remove

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:10 -08:00
Peter Huewe 6a7fd2db79 staging/xgifb: Remove unneeded conditional assignment
pVBInfo->ram_type is assigned the return value of
XGINew_GetXG20DRAMType which can only be 0, 1 or 2

-> The conditional assignment is not needed here as it always evaluates
to true.
-> remove

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:10 -08:00
Peter Huewe 46a12dfdbe staging/xgifb: Remove unused values in XGI340_ECLKData
In the lookup table XGI340_ECLKData only the first three 'lines' are
used, thus the remaining entries can be removed.

Rationale:
- vb_init.c uses pVBInfo->ram_type as the index for XGI340_ECLKData.

- pVBInfo->ram_type is assigned the return value of
XGINew_GetXG20DRAMType which can only be 0, 1 or 2

-> only the first three values are used.
-> remove the remeining entries.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:09 -08:00
Peter Huewe 44b8185007 staging/xgifb: Remove unused entries in XGI340New_MCLKData and XGI27New_MCLKData
In the lookup tables XGI340New_MCLKData and XGI27New_MCLKData only the
first three 'lines' are used, thus the remaining fields can be removed.

Rationale:
- vb_init.c uses pVBInfo->ram_type as the index for pVBInfo->MCLKData

- pVBInfo->ram_type is assigned the return value of
XGINew_GetXG20DRAMType which can only be 0, 1 or 2

- pVBInfo->MCLKData is assigned to either XGI340New_MCLKData or
XGI27New_MCLKData in vb_setmode.c

-> only the first three values are used, the rest can be removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:09 -08:00
Peter Huewe 86c6c948da staging/xgifb: Remove unused values in XG27_SR13 and XGI340_SR13
In the lookup tables XG27_SR13 and XGI340_SR13 only the first three
 values are used of each 'line', thus the remaining fields can be
 removed.

Rationale:
- vb_init.c uses pVBInfo->ram_type for the 'column' index for
pVBInfo->SR15.

- pVBInfo->ram_type is assigned the return value of
XGINew_GetXG20DRAMType which can only be 0, 1 or 2

- pVBInfo->SR15 is assigned to either XG27_SR13 or XGI340_SR13 in
vb_setmode.c

-> only the first three values are used.
This becomes also evident as values 3-7 are all 0.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:09 -08:00
Peter Huewe 87be0afafa staging/xgifb: Remove unused values in XGI340_cr41 and XGI27_cr41
In the lookup tables XGI340_cr41 and XGI27_cr41 only the first three
values are used of each 'line', thus the remaining fields can be
removed.

Rationale:
- vb_init.c uses pVBInfo->ram_type for the 'column' index for
pVBInfo->CR40.

- pVBInfo->ram_type is assigned the return value of
  XGINew_GetXG20DRAMType which can only be 0, 1 or 2

- pVBInfo->CR40 is assigned to either XGI340_cr41 or XGI27_cr41 in
vb_setmode.c

-> only the first three values are used.
This becomes also evident as values 3-7 are all 0.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:09 -08:00
Olof Johansson bda6f8e6cd ARM: tegra: Common Clock Framework rework
Tegra already supports the common clock framework, but had issues:
 
 1) The clock driver was located in arch/arm/mach-tegra/ rather than
    drivers/clk/.
 
 2) A single "Tegra clock" type was implemented, rather than separate
    clock types for PLL, mux, divider, ... type in HW.
 
 3) Clock lookups by device drivers were still driven by device name
    and connection ID, rather than through device tree.
 
 This pull request solves all three issues. This required some DT changes
 to add clocks properties, and driver changes to request clocks more
 "correctly". Finally, this rework allows all AUXDATA to be removed from
 Tegra board files, and various duplicate clock lookup entries to be
 removed from the driver.
 
 This pull request is based on the previous pull request, with tag
 tegra-for-3.9-cleanup.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRCYtBAAoJEMzrak5tbycxKb8P/0cXt2X7mPfoApWV96bI2c9h
 VE1wZYREcq0Au3hiNuMmPp1Nwous2zvrXRKXMvLoQi42KwpvZlFjlyn8+xACKmxO
 okSJ+aXETzlGh85l5RlnFJMgq181Kn0nDhN5Iwy0FUEJ8/oqdS8fEz5mwQlHflX1
 CLaquDVr/edr8LffvsFlxtSmeYNvZ2jYkSgroWeDhVR5Np1/LUCyh5y3edjVl/es
 B0/keuZ2fnYZnEfqLTpBEARYDBimymuu8gIoHK5nvtz3d/GGu92sVeda4LuHt8eH
 1N+f41ceDR2JG/MIJbLr6PGYmCkAGSM/5Vcfa33G+A7GQT0EVb8jLozGCdrCjaEG
 OM33pN5wtv1M9gTLR9swITBWhbTpRWaHnXeZQF7ttaV8dvr/fuOzWBw47k8Jw0FJ
 zjGta66kwW7WkT3HDNoM2RRzm9dlJr1xdHOzAaVJnX3VHtHcIvYzDi90Xv9Nn46D
 E/qIpExmL4rMrb2+4MxT9CdbfzdBSmsnlRFoWZTIM1NPxA/97i7oAyYVAJ34LCNx
 xWqwimhXK14LzGffpSHm9CSz8DHNbehDZRMQD0jGYMn61PFtDB+E/oEq5AEqneuC
 KDht3Qdx/mPzJQPE8WV3d5FxeXfXDjj203x/i6x8TOdH8Bt4aoK9ajvPYBpA+2aE
 4fPJIobLHGYN/F+GF1VJ
 =s9hz
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-3.9-soc-ccf' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/soc

From Stephen Warren:
ARM: tegra: Common Clock Framework rework

Tegra already supports the common clock framework, but had issues:

1) The clock driver was located in arch/arm/mach-tegra/ rather than
   drivers/clk/.

2) A single "Tegra clock" type was implemented, rather than separate
   clock types for PLL, mux, divider, ... type in HW.

3) Clock lookups by device drivers were still driven by device name
   and connection ID, rather than through device tree.

This pull request solves all three issues. This required some DT changes
to add clocks properties, and driver changes to request clocks more
"correctly". Finally, this rework allows all AUXDATA to be removed from
Tegra board files, and various duplicate clock lookup entries to be
removed from the driver.

This pull request is based on the previous pull request, with tag
tegra-for-3.9-cleanup.

* tag 'tegra-for-3.9-soc-ccf' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra: (31 commits)
  clk: tegra30: remove unused TEGRA_CLK_DUPLICATE()s
  clk: tegra20: remove unused TEGRA_CLK_DUPLICATE()s
  ARM: tegra30: remove auxdata
  ARM: tegra20: remove auxdata
  ASoC: tegra: remove auxdata
  staging: nvec: remove use of clk_get_sys
  ARM: tegra: paz00: add clock information to DT
  ARM: tegra: add clock properties to Tegra30 DT
  ARM: tegra: add clock properties to Tegra20 DT
  spi: tegra: do not use clock name to get clock
  ARM: tegra: remove legacy clock code
  ARM: tegra: migrate to new clock code
  clk: tegra: add clock support for Tegra30
  clk: tegra: add clock support for Tegra20
  clk: tegra: add Tegra specific clocks
  ARM: tegra: define Tegra30 CAR binding
  ARM: tegra: define Tegra20 CAR binding
  ARM: tegra: move tegra_cpu_car.h to linux/clk/tegra.h
  ARM: tegra: add function to read chipid
  ARM: tegra: fix compile error when disable CPU_IDLE
  ...

Signed-off-by: Olof Johansson <olof@lixom.net>

Conflicts:
	arch/arm/mach-tegra/board-dt-tegra20.c
	arch/arm/mach-tegra/board-dt-tegra30.c
	arch/arm/mach-tegra/common.c
	arch/arm/mach-tegra/platsmp.c
	drivers/clocksource/Makefile
2013-02-05 12:13:10 -08:00
Peter Huewe fc008afff8 staging/xgifb: Remove unused variable
After the patch
'staging/xgifb: Don't write the same values x times'
the local variable i is unused, which leads to the following warning:

driverrs/staging/xgifb/vb_init.c: In function
‘XGINew_SetDRAMDefaultRegister340’:
drivers/staging/xgifb/vb_init.c:433:43: warning: unused variable ‘i’
[-Wunused-variable]

This patch fixes this

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:55:08 -08:00
Greg Kroah-Hartman 4e98fcfb95 Third set of IIO new drivers, cleanups and fixes for the 3.9 cycle
New drivers
 1) A driver for ST microelectronics sensors.  This driver already covers
    a large set of new parts (20 gyros, accelerometer and magnetometers)
    not currently covered by the existing drivers.  The intent moving forward
    is to merge this with the other drivers for similar parts already in tree.
    The lis3l02dq driver currently in staging/iio will be trivial, the lis3
    driver in misc more complex as it has a number of additional interfaces.
    Any merging in of the lis3 driver will rely on the not currently
    merged iio_input bridge driver and handling of freefall notifications
    etc.
 
 2) A driver for the itg3200 gyroscope.
 
 Graduations from staging
 1) Cleanup and move out of staging of the adxrs450 gyroscope driver.  The
    cleanup required was all minor but there were a couple of fixes hidden in
    there.
 
 Core and driver additions
 1) Initial work from Guenter Roeck on device tree support for IIO's provider/
    consumer code. Focuses on the iio_hwmon driver and the max1363 adc driver.
    The full device tree syntax is currently under discussion but should
    follow shortly.
 
 Cleanups and fixes
 1) Remove a noop function __iio_update_buffer
 2) Couple of small fixes and cleanups for the max1363
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRDQDyAAoJEFSFNJnE9BaIqZMP/i2fNpArDu3jXchJZJ1WuB0L
 eY3JdMWOCO/ujPnjf6qWCjqZ+GWzFSSE8q+ZfUFYRv42Hcu2WV06eAeczilRJwzu
 ZZAiWvWMTRV5tIAyg6guMoQvoxA5IHr5nG8JJ6OxY3ZtnnZr76kGm2/XIZCiy23d
 1gFZOm9rew/lozbLdO16kcUm2WNBpX78PHStyQRUFjCGyDaM+BTFQjvZ+xRxKM9o
 G3/snb/ExIIwlrIhwSZecmBhZoXvQhSIl49sKyT2EWGoNdDnC9YqTeYp3UYtBUuO
 3uQ6ne1xGZRBu97CjnKEVpLFAd+xVjB8I2i5CeZWDBUQIkb0DEXV3blOaOLEks0J
 bePhrlyDArdri18CQFFx2h5NwP87SjZ+U4zQkA63JWAXGC/w+vXp+MhxZpdvWXEy
 jI0SKlxaeD5a1N0helc8zvibMZDsYMQSMz+BoI9Js3YpOypz6YNgaaSG8lI1rZ8W
 YOsJiBWl6/jzg36QetD2Uhf8vVsA5KtDLSlLQbUBBjnvrN4XcPr/hWa2tv2GHnGh
 /YMqWA1wOxNSAMaqn1bdJKDNm02+j7B8DfY+3E5m6fVTxwgHQmfPsECrY8k2i6ma
 aMNDNuGnDCbpn8dKiIyQuvt+/1lktClcBcdHWUe/FGZtHdV7Kan5pDZQFLqoddCJ
 mUE2y65xc4Hc2pmjWyim
 =E5mK
 -----END PGP SIGNATURE-----

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

Jonathan writes:

"Third set of IIO new drivers, cleanups and fixes for the 3.9 cycle

New drivers
1) A driver for ST microelectronics sensors.  This driver already covers
   a large set of new parts (20 gyros, accelerometer and magnetometers)
   not currently covered by the existing drivers.  The intent moving forward
   is to merge this with the other drivers for similar parts already in tree.
   The lis3l02dq driver currently in staging/iio will be trivial, the lis3
   driver in misc more complex as it has a number of additional interfaces.
   Any merging in of the lis3 driver will rely on the not currently
   merged iio_input bridge driver and handling of freefall notifications
   etc.

2) A driver for the itg3200 gyroscope.

Graduations from staging
1) Cleanup and move out of staging of the adxrs450 gyroscope driver.  The
   cleanup required was all minor but there were a couple of fixes hidden in
   there.

Core and driver additions
1) Initial work from Guenter Roeck on device tree support for IIO's provider/
   consumer code. Focuses on the iio_hwmon driver and the max1363 adc driver.
   The full device tree syntax is currently under discussion but should
   follow shortly.

Cleanups and fixes
1) Remove a noop function __iio_update_buffer
2) Couple of small fixes and cleanups for the max1363
"
2013-02-05 11:25:37 -08:00
Ian Abbott cc400e185c staging: comedi: check s->async for poll(), read() and write()
Some low-level comedi drivers (incorrectly) point `dev->read_subdev` or
`dev->write_subdev` to a subdevice that does not support asynchronous
commands.  Comedi's poll(), read() and write() file operation handlers
assume these subdevices do support asynchronous commands.  In
particular, they assume `s->async` is valid (where `s` points to the
read or write subdevice), which it won't be if it has been set
incorrectly.  This can lead to a NULL pointer dereference.

Check `s->async` is non-NULL in `comedi_poll()`, `comedi_read()` and
`comedi_write()` to avoid the bug.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:23:32 -08:00
H Hartley Sweeten 4a79f73017 staging: comedi: remove 'comedi_autoconfig' module parameter
This module parameter is used to enable the auto config mechanism
in the comedi core. Most of the PCI, PCMCIA, and USB drivers have
been converted to use the auto config mechanism and will not attach
if it is disabled.

Since the 'comedi_autoconfig' parameter is defaulted to true, just
remove it so that the comedi drivers that use auto config will
always be able to 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>
2013-02-05 11:22:08 -08:00
H Hartley Sweeten bd7807f964 staging: comedi: quatech_daqp_cs: factor out common ai scanlist code
Factor the code that programs the analog input scanlist out of the
daqp_ai_insn_read() and daqp_ai_cmd() functions.

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>
2013-02-05 11:18:58 -08:00
H Hartley Sweeten d35dcc89fc staging: comedi: quatech_daqp_cs: fix daqp_ao_insn_write()
The (*insn_write) functions are expected to write 'insn->n' number
of samples to the channel. Fix this function so it works as the
comedi core expects.

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>
2013-02-05 11:18:58 -08:00
H Hartley Sweeten 6a911d8aa5 staging: comedi: quatech_daqp_cs: use (*insn_bits) for digital outputs
Change the subdevice operation used to write the digital outputs from
a (*insn_write) to a (*insn_bits) function. The (*insn_write) functions
are expected to write 'insn->n' number of samples. The (*insn_bits)
functions just write a single sample (insn->n = 1). Change the return
from '1' to 'insn->n' to clarify what the return is.

Using an (*insn_bits) function to write the digital outputs also allows
the user to read the current state of the output channels.

Fix the io operation used to update the digital outputs. The register is
only 8-bits and should by updated with an outb() not an outw().

Also, set the 'maxdata' for the subdevice. For digital io this value
should be '1' (digital io can only be 1 or 0).

Remove the setting of the len_chanlist for the subdevice. This variable
only has meaning for subdevices that support asynchronous commands. The
comedi core will initialize it appropriately during the postconfig.

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>
2013-02-05 11:18:58 -08:00
H Hartley Sweeten 62100fefbc staging: comedi: quatech_daqp_cs: use (*insn_bits) for digital inputs
Change the subdevice operation used to read the digital inputs from
a (*insn_read) to a (*insn_bits) function. The (*insn_read) functions
are expected to read 'insn->n' number of samples. The (*insn_bits)
functions just read a single sample (insn->n = 1). Change the return
from '1' to 'insn->n' to clarify what the return is.

Also, set the 'maxdata' for the subdevice. For digital io this value
should be '1' (digital io can only be 1 or 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>
2013-02-05 11:18:58 -08:00
H Hartley Sweeten 491cc0b042 staging: comedi: quatech_daqp_cs: remove unused define
The MAX_DEV define is no longer used in this driver. Remove it.

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>
2013-02-05 11:18:58 -08:00
H Hartley Sweeten 1801726e87 staging: comedi: quatech_daqp_cs: rename the private data struct
The private data in this driver is associated with the comedi_device
pointer not the pcmcia_device. For aesthetic reasons, rename the
private data struct from local_into_t to daqp_private.

Also, rename the local variables used for the private data from
local to devpriv as that is more common in 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>
2013-02-05 11:18:57 -08:00
H Hartley Sweeten c12717423e staging: comedi: quatech_daqp_cs: store private data in the comedi_device
All the comedi_subdevices in this driver use the same 'local' private data.
Instead of storing the pointer to the private data in each subdevice, just
store it in the comedi_device.

Also, instead of passing the private data pointer to pcmcia_request_irq()
in link->priv, pass the comedi_device pointer. This allows removing the
comedi_device and comedi_subdevice pointers from the private data. We can
get them as needed from the void * in the interrupt function.

Fix the pcmcia suspend/resume functions so they use the comedi_device
pointer stored in link->priv to then get the private data 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>
2013-02-05 11:18:57 -08:00
H Hartley Sweeten 9c1dcce9c6 staging: comedi: quatech_daqp_cs: ao subdevice does not support commands
The analog output subdevice does not support aynchronous commands.
Don't set the dev->write_subdev to this subdevice.

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>
2013-02-05 11:18:57 -08:00
H Hartley Sweeten 25736670bc staging: comedi: quatech_daqp_cs: use comedi_pcmcia_disable() for (*detach)
The (*detach) function, daqp_detach() is now a simple wrapper around
comedi_pcmcia_disable(). Just use comedi_pcmcia_disable() directly for
the (*detach).

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>
2013-02-05 11:18:57 -08:00
H Hartley Sweeten 87fe1452c6 staging: comedi: quatech_daqp_cs: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA 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>
2013-02-05 11:18:57 -08:00
H Hartley Sweeten c04edbf2f4 staging: comedi: quatech_daqp_cs: convert to auto attach
Convert this pcmcia driver to the comedi auto attach mechanism.

This allows getting rid of the static data that held "A list of
"instances" of the device" that was used to pass the pcmcia_device
pointer from the pcmcia_driver to the comedi_driver.

Also, remove the now unused variables in the private data that
were used to pass the pcmcia_device.

Remove the code that pulled the model number of the card out of
the PCMCIA CIS and stashed it in the private data since it is
not used in the 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>
2013-02-05 11:18:57 -08:00
Peter Huewe f951dd05f9 staging/xgifb: Consolidate if branches with similar conditions
1) The same condition (pVBInfo->IF_DEF_LVDS == 0) was checked in the if
clause directly in front of this one.

2) The same condition pVBInfo->VBType & (VB_SIS301B | VB_SIS302B |
VB_SIS301LV | VB_SIS302LV | VB_XGI301C) was checked in the if
clause directly in front of this one.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:22 -08:00
Peter Huewe 826215d98f staging/xgifb: Consolidate if/else for 'identical' branches
Since XGI_LCDDesStruct is fully contained in XGI330_LCDDataDesStruct2
and the offsets for the first members is identical we can consolidate
the if/else branches here and use XGI330_LCDDataDesStruct2 for
everything.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:22 -08:00
Peter Huewe 1504ecbeec staging/xgifb: Don't write the same values x times
With the previous patch 'Move duplicated code for dram to helper
function' it becomes evident that the code is performing the same
thing 4 or 8 times in a row without changing arguments to the function
and thus writing the same values over and over again.

It was tested that these repeats are unnecessary.

-> we can safely remove them.

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:21 -08:00
Peter Huewe 0141bb2ed9 staging/xgifb: Move duplicated code for dram to helper function
XGINew_SetDRAMDefaultRegister340 uses the same code fragment 4 times
with only a slight variation each time.
-> Move this code to a helper function - this saves some lines and
~450bytes in the .o / .ko

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:21 -08:00
Peter Huewe 227dc1156c staging/xgifb: Replace XGI340_CR6B table with simple if/else
The XGI340_CR6B lookup table consists of the entries
{0xaa, 0xaa, 0xaa, 0xaa} for an index <= 2 and
{0x00, 0x00, 0x00, 0x00} for all other indices.

The only user XGINew_SetDRAMDefaultRegister340 loops over these 4 values
of a line with a for loop and since all entries are the same for each line
we can simply replace the whole lookup table with a simple if/else assignment.

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:21 -08:00
H Hartley Sweeten 5056d87a88 staging: comedi: ni_daq_700: use comedi_pcmcia_disable() for (*detach)
The (*detach) function, daq700_detach() is now a simple wrapper around
comedi_pcmcia_disable(). Just use comedi_pcmcia_disable() directly for
the (*detach).

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>
2013-02-04 14:47:19 -08:00
H Hartley Sweeten 7dc99109f5 staging: comedi: ni_daq_700: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver does not use interrupts and is not an audio device,
remove CONF_ENABLE_IRQ and CONF_AUTO_AUDIO from the link->config_flags.

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>
2013-02-04 14:47:19 -08:00
H Hartley Sweeten 95f932cea3 staging: comedi: das08_cs: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver does not use interrupts so remove CONF_ENABLE_IRQ from
the link->config_flags.

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>
2013-02-04 14:47:19 -08:00
H Hartley Sweeten 7fadd565f0 staging: comedi: cb_das16_cs: use comedi_pcmcia_disable() for (*detach)
The (*detach) function, das16cs_detach() is a simple wrapper around
comedi_pcmcia_disable(). Just use comedi_pcmcia_disable() directly
for the (*detach).

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>
2013-02-04 14:47:19 -08:00
H Hartley Sweeten bcd22e8ece staging: comedi: cb_das16_cs: use pcmcia_request_irq()
Use pcmcia_request_irq() instead of request_irq() to request the
irq for the PCMCIA device. This allows the PCMCIA core to clean
up the registration in 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>
2013-02-04 14:47:19 -08:00
H Hartley Sweeten 9e29ce104a staging: comedi: cb_das16_cs: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA 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>
2013-02-04 14:47:18 -08:00
H Hartley Sweeten ddb2d0a018 staging: comedi: comedi_pcmcia: introduce comedi_pcmcia_{enable, disable}
Introduce some helper functions to enable/disable the PCMCIA device.
This will allow removing some of the boilerplate code in the comedi
PCMCIA 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>
2013-02-04 14:47:18 -08:00
Peter Huewe e44adfdb67 staging/xgifb: Simplify XGISetModeNew
This patch simplifies the code of XGISetModeNew by reordering the
if/else if/case conditions when both branches are doing exactly the
same.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:28 -08:00
Peter Huewe 06cc47b90b staging/xgifb: Consolidate XGI_EnableChISLCD and XGI_DisableChISLCD
These two functions share the same code except one line - thus we can
simply merge them and add a parameter to switch between both variants.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:28 -08:00
Peter Huewe 5d1c2a9b28 staging/xgifb: Remove unnecessary bitshifts in XGI_SetCRT1ModeRegs
Since data can only be 0x0000, 0x0035 or 0x0048 we can simply skip the
bit shifting and masking as data & 0xFF is always equal to data and
data & 0xFF00 is always 0.
So we simply use data and 0 directly and save the assignment.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:28 -08:00
Peter Huewe a5e080b83e staging/xgifb: remove unnecessary temp variable in XGIfb_mode_rate_to_ddata
Instead of subtracting one and then assign a different name and add 1
again we simply use HDE directly. HDE wasn't used directly before, so no
change in functionality.
Same applies to VDE.

-> now we can remove the variable with the very descriptive name E ;)

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe bae31702cd staging/xgifb: rewrite XGIfb_get_cmap_len
We don't need to use this switch-case here for a simple two case
if-else.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe 76a5899b0c staging/xgifb: Simplify XGI_SetSeqRegs
Since SR[0] in the (readonly) XGI330_StandTable is always 0x01 we can
skip or'ing with 0x01 and make the code simpler by removing the if
statements.

Since this function is the only user of the XGI330_StandTable we can
also include the unconditional |= 0x20 into the input data and move the
assignment to SR1 into the loop, which I prefer to start at 0.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe fd1bbbb79e staging/xgifb: Fix return of uninitialized variable
Clang warning:
drivers/staging/xgifb/XGI_main_26.c: warning: variable 'ret' is
used uninitialized whenever 'if' condition:
	if (xgifb_info->mode_idx < 0) {
evaluates to true.

drivers/staging/xgifb/XGI_main_26.c:
note: uninitialized use occurs here
	return ret;

This patch initializes the variable in this case.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe 8cedcc7022 staging/xgifb: mttr must be (signed) int
The mttr field must be declared as signed int (as in every other fb
driver) for the mttr functions to work properly.
Moreover the value should be initialized with -1.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe 44e1312c68 staging/xgifb: Remove always false comparisons
This patch removes some comparisons that always evaluate to false since
xoffset and yoffset are defined as __u32 in fb_var_screeninfo in
include/linux/fb.h and thus can never be negative.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe f2c22605c5 staging/xgifb: Simplify XGI_GetRatePtrCRT2
Since the smaller LCDRefreshIndex is contained identically in LCDARefreshIndex
we can simply use LCDARefreshIndex and skip the if/else.

Since LCDARefreshIndex is only used readonly and contains only small
unsigned values we also change its declaration to const u8.

In order to prevent an out-of-bounds access I changed the mask from 0x0F
to 0x07 and added a dummy value.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Minchan Kim 3de738cd30 zram: give up lazy initialization of zram metadata
1) User of zram normally do mkfs.xxx or mkswap before using
   the zram block device(ex, normally, do it at booting time)
   It ends up allocating such metadata of zram before real usage so
   benefit of lazy initialzation would be mitigated.

2) Some user want to use zram when memory pressure is high.(ie, load zram
   dynamically, NOT booting time). It does make sense because people don't
   want to waste memory until memory pressure is high(ie, where zram is really
   helpful time). In this case, lazy initialzation could be failed easily
   because we will use GFP_NOIO instead of GFP_KERNEL for avoiding deadlock.
   So the benefit of lazy initialzation would be mitigated, too.

3) Metadata overhead is not critical and Nitin has a plan to diet it.
   4K : 12 byte(64bit machine) -> 64G : 192M so 0.3% isn't big overhead
   If insane user use such big zram device up to 20, it could consume 6% of ram
   but efficieny of zram will cover the waste.

So this patch gives up lazy initialization and instead we initialize metadata
at disksize setting time.

Acked-by: Jerome Marchand <jmarchand@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:52:49 -08:00
Minchan Kim 0231c403bb zram: force disksize setting before using zram
Now zram document syas "set disksize is optional"
but partly it's wrong. When you try to use zram firstly after
booting, you must set disksize, otherwise zram can't work because
zram gendisk's size is 0. But once you do it, you can use zram freely
after reset because reset doesn't reset to zero paradoxically.
So in this time, disksize setting is optional.:(
It's inconsitent for user behavior and not straightforward.

This patch forces always setting disksize firstly before using zram.
Yes. It changes current behavior so someone could complain when
he upgrades zram. Apparently it could be a problem if zram is mainline
but it still lives in staging so behavior could be changed for right
way to go. Let them excuse.

Acked-by: Jerome Marchand <jmarchand@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:52:49 -08:00
Minchan Kim 7e5a5104c6 zram: Fix deadlock bug in partial read/write
Now zram allocates new page with GFP_KERNEL in zram I/O path
if IO is partial. Unfortunately, It may cause deadlock with
reclaim path like below.

write_page from fs
fs_lock
allocation(GFP_KERNEL)
reclaim
pageout
				write_page from fs
				fs_lock <-- deadlock

This patch fixes it by using GFP_NOIO.  In read path, we
reorganize code flow so that kmap_atomic is called after the
GFP_NOIO allocation.

Cc: stable@vger.kernel.org
Acked-by: Jerome Marchand <jmarchand@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
[ penberg@kernel.org: don't use GFP_ATOMIC ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:52:49 -08:00
H Hartley Sweeten 7f70410fe0 pci_ids.h: add common pci vendor ids from comedi subsystem
There are a number of pci vendor ids that are used in multiple
drivers in the comedi subsystem. Move these ids to pci_ids.h.

This also fixes some build warnings reported by the kbuild test
robot about PCI_VENDOR_ID_AMPLICON being undeclared.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:49:16 -08:00
Ian Abbott 4c4bc25d0f staging: comedi: ni_labpc: correct differential channel sequence for AI commands
Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
meaningful output from a Lab-PC+ in differential mode for AI cmds, but
AI insn reads gave correct readings.  He tracked it down to two
problems, one of which is addressed by this patch.

It seems the setting of the channel bits for particular scanning modes
was incorrect for differential mode.  (Only half the number of channels
are available in differential mode; comedi refers to them as channels 0,
1, 2 and 3, but the hardware documentation refers to them as channels 0,
2, 4 and 6.)  In differential mode, the setting of the channel enable
bits in the command1 register should depend on whether the scan enable
bit is set.  Effectively, we need to double the comedi channel number
when the scan enable bit is not set in differential mode.  The scan
enable bit gets set when the AI scan mode is `MODE_MULT_CHAN_UP` or
`MODE_MULT_CHAN_DOWN`, and gets cleared when the AI scan mode is
`MODE_SINGLE_CHAN` or `MODE_SINGLE_CHAN_INTERVAL`.  The existing test
for whether the comedi channel number needs to be doubled in
differential mode is incorrect in `labpc_ai_cmd()`.  This patch corrects
the test.

Thanks to Tuomas for suggesting the fix.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: <stable@vger.kernel.org> # 3.7.x, 3.8.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:45:07 -08:00
Ian Abbott 22056e2b46 staging: comedi: ni_labpc: set up command4 register *after* command3
Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
meaningful output from a Lab-PC+ in differential mode for AI cmds, but
AI insn reads gave correct readings.  He tracked it down to two
problems, one of which is addressed by this patch.

It seems that writing to the command3 register after writing to the
command4 register in `labpc_ai_cmd()` messes up the differential
reference bit setting in the command4 register.  Set up the command4
register after the command3 register (as in `labpc_ai_rinsn()`) to avoid
the problem.

Thanks to Tuomas for suggesting the fix.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: <stable@vger.kernel.org> # 3.7.x, 3.8.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:45:07 -08:00
Ian Abbott de06d7c6b8 staging: comedi: restrict comedi_set_hw_dev() usage
Don't allow comedi drivers to change `dev->hw_dev` using
`comedi_set_hw_dev()` if it's already been set.  Return `-EEXIST` in
that case.

`dev->hw_dev` needs to be set to NULL by the core during clean-up of the
comedi device, so add a local function `comedi_clear_hw_dev()` to do
that.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:44:20 -08:00
Ian Abbott da71751177 staging: comedi: export comedi_set_hw_dev()
Chnage the inline `comedi_set_hw_dev()` to an exported function and
change it's return type from `void` to `int` so we can impose some
restrictions (in a later patch) and return an error if necessary.

Only a few comedi drivers call this, although they don't need to if the
hardware device has been attached automatically via
`comedi_auto_config()` and the comedi driver's `auto_attach()` method.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:44:19 -08:00
Ian Abbott f65cc5447e staging: comedi: change comedi_alloc_subdevice_minor parameters
`comedi_alloc_subdevice_minor()` doesn't really need a parameter
pointing to a `struct comedi_device` as it can get this information from
the parameter pointing to a `struct comedi_subdevice`.  Just pass the
subdevice parameter.

Signed-by: Ian Abbott <abbotti@mev.co.uk>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:43:28 -08:00
Ian Abbott e9ab1c2f7e staging: comedi: move comedi_alloc_subdevice_minor declarations
Move the declarations of `comedi_alloc_subdevice_minor()` and
`comedi_free_subdevice_minor()` from "comedidev.h" to
"comedi_internal.h" since they are only of interest to the comedi core,
and are not exported to the low-level comedi drivers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:43:27 -08:00
Garrick He eec0d0dc4e Staging: wlan-ng: Fix tab coding style issue in hfa384x.h
Fix all 'please, no space before tabs' warning found by checkpatch.pl

Signed-off-by: Garrick He <garrickhe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:42:07 -08:00
H Hartley Sweeten f91f9beaa1 staging: comedi: das08: split out bus specific code
Split the bus specific ISA/PC-104 and PCI code out of this driver
and create two new drivers, das08_isa and das08_pci.

This allows removing all the #ifdef'ery in the das08 driver that
handled if the CONFIG_COMEDI_DAS08_{ISA,PCI} options were enabled.

It also makes the PCI driver cleanly Plug-and-Play since the comedi
driver only has an auto_attach callback. Previously it also had an
attach callback in order to handle the ISA cards.

Since the PCMCIA support was already split out, we can also remove
the now unused enum das08_bustype and it's use in the boardinfo.
The bus specific code deals with the bustype automatically before
it calls the common attach function in das08.

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>
2013-02-03 17:33:08 -08:00
Andres More ec6e0f63d6 staging: vt6656: fix C99 // comments in main_usb.c
Resolved 'do not use C99 // comments' checkpatch errors.
Many warnings about odd indentation were left.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More d3e2395154 staging: vt6656: fixed C99 // comments in two headers
Cleared 'do not use C99 // comments' checkpatch error in device.h and
device_cfg.h

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More 84cf5fcbb5 staging: vt6656: cleared C99 // comments in datarate.c
Cleared 'do not use C99 // comments' checkpatch error, several warnings
about code indentation and camel casing were not resolved.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More c16fdffc2d staging: vt6656: fixed C99 // comments
Cleared 'do not use C99 // comments' checkpatch errors in two headers.
Several obvious comments were removed.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More 74ecdc5e4b staging: vt6656: cleared 'do not use C99 // comments' checkpatch errors
Switched // comments into respective /**/ ones

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:30:41 -08:00
Andres More 77970254b0 staging: vt6656: cleared 'do not use C99 // comments' checkpatch errors
switched all // comments on file to respective /**/

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:30:41 -08:00
H Hartley Sweeten 42d1aeea84 staging: comedi: ni_mio_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 ni_mio_common.c uses it. Cleanup
ni_getboardtype() so it returns a pointer to the boardinto instead
of the index.

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>
2013-02-03 17:29:47 -08:00
H Hartley Sweeten 42e4472ef1 staging: comedi: ni_labpc_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 ni_labpc 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>
2013-02-03 17:29:47 -08:00
H Hartley Sweeten 89d714ce63 staging: comedi: ni_daq_dio24: remove some unnecessary includes
This driver does not use anything from the interrupt.h, slab.h,
and ioport.h headers. Don't bother including them.

For aesthetic reasons, move the include of the comedi specific
8255.h header to the end of the 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>
2013-02-03 19:27:38 -06:00
H Hartley Sweeten 5a1daad46a staging: comedi: ni_daq_dio24: 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 as well as the
now unnecessary boardinfo.

Check the call to subdev_8255_init() for success. That function does
a kzalloc and could return -ENOMEM.

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>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 6746dc6340 staging: comedi: ni_daq_dio24: cleanup dio24_detach
Simplify the call to subdev_8255_cleanup() to remove the
need for a local variable.

This driver only attaches to pcmcia devices so the test for
thisboard != pcmcia_bustype will always fail. Remove the test
and the unreachable release_region().

This driver also never does a request_irq() so remove the
free_irq().

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>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 5316ec5453 staging: comedi: ni_daq_dio24: remove '#undef LABPC_DEBUG'
The LABPC_DEBUG define is not used in this driver. Just remove the

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>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 61f828ec59 staging: comedi: ni_daq_dio24: remove comedi private data
The comedi private data, struct dio24_private, is not used in
the driver. Remove it and the kzalloc.

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>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 41722460b7 staging: comedi: ni_daq_dio24: remove the '#ifdef incomplete' code
All the '#ifdef incomplete' code deals with interrupt support in
this driver. For now just remove all this #if'defed out code.

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>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten fb89942cb3 staging: comedi: ni_daq_dio24: 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>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 25602bd735 staging: comedi: ni_daq_dio24: move comedi_driver declaration
Move the comedi_driver declaration down in the file. This removes
the need for the 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>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 112215012f staging: comedi: ni_daq_dio24: 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
probe 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>
2013-02-03 19:27:36 -06:00
H Hartley Sweeten 07c5b441de staging: comedi: ni_daq_dio24: cleanup pcmcia probe/remove
Absorb the code from dio24_config() into the probe function,
dio24_cs_attach() and properly return the error code when the
probe fails. This also gets rid of an unnecessary forward
declaration.

For aesthetic reasons, move the remove functio, dio24_cs_detach(),
so it's after the probe function.

Remove a number of dev_{level} noise messages in the probe/remove
functions.

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>
2013-02-03 19:27:36 -06:00
H Hartley Sweeten 7044ae812b staging: comedi: ni_daq_dio24: 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>
2013-02-03 19:27:36 -06:00
H Hartley Sweeten 0bfc02b8e5 staging: comedi: ni_daq_dio24: 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>
2013-02-03 19:27:36 -06:00
H Hartley Sweeten de46fb7776 staging: comedi: ni_daq_dio24: remove dio24_release()
This function simply calls pcmcia_disable_device(). Remove it and
just call pcmcia_disable_device() where needed.

Also, remove a couple unnecessary 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>
2013-02-03 19:27:36 -06:00
H Hartley Sweeten 7b725aaedd staging: comedi: ni_daq_dio24: 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>
2013-02-03 19:27:36 -06:00
H Hartley Sweeten 573c43f30e staging: comedi: ni_daq_dio24: 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>
2013-02-03 19:27:35 -06:00
Peter Huewe e2e544c9d5 staging/xgifb: remove unused variables
XGI_P3cc is unused and the assignment without side effects -> remove;
Data can be simply replaced by the Temp variable, which was changed to
temp in order to make checkpatch happy.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:26:14 -06:00
Peter Huewe 5fc699f608 staging/xgifb: Remove redundant if statement
The code checks twice for if (pVBInfo->VBInfo & SetCRT2ToTV) without any
changes in between -> we can remove the second check.
And while at it we can also save the temp variable and use tempbx
directly.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:26:14 -06:00
Peter Huewe a9e29e6d41 staging/xgifb: Remove unused variables
Pindex and Pdata are unused -> remove
tempbx is unused -> remove

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:26:13 -06:00
Peter Huewe ef9a6b99a0 staging/xgifb: Remove unused variable and dead assignment
modeflag is unused in XGI_SetSeqRegs, XGI_GetTVInfo,
  XGI_SetLCDRegs, XGI_GetRatePtrCRT2 -> remove

resinfo is unused in XGI_PreSetGroup1, XGI_SetGroup1, XGI_SetGroup2,
  XGI_SetLCDRegs -> remove

push1,push2 are unused in XGI_SetLCDRegs -> remove

CRT1Index is unused in XGI_PreSetGroup1, XGI_SetLockRegs,
  XGI_SetLCDRegs -> remove

tempcx in XGI_PreSetGroup1 only holds the values 4,5,6
  -> change its type to u8

crt2crtc is unused in XGI_SetGroup2 -> remove

CRT2Index is unused in XGI_GetVCLK2Ptr -> remove.

Assignment to i is dead in XGI_SetSeqRegs since it is not used before
  the next assignment -> remove the dead assignment.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:26:13 -06:00
Peter Huewe e91b50ecf3 staging/xgifb: Remove unused variable
Index is not used here -> remove.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:26:13 -06:00
Peter Huewe ecfaa00c00 staging/xgifb: Remove unused variables and dead assignments
The variables A,HBS and VBS are never read in XGIfb_mode_rate_to_ddata
and the assignment has no side effects -> so we can simply remove them.
Removing them causes VT, HT and cr_data3 to be unused -> remove them as well
and remove the assignmens to cr_data which are shadowed by a different
assignment a few lines later.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:26:13 -06:00
Guenter Roeck ca7d98dbd7 iio: Update iio_channel_get_all and iio_channel_get_all_cb API
Pass device pointer instead of device name as parameter to iio_channel_get_all
and iio_channel_get_all_cb. This will enable us to use OF information to
retrieve consumer channel information.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02 11:58:46 +00:00
Guenter Roeck a11e619b80 staging/iio: (iio_hwmon) Basic devicetree support
Add 'iio-hwmon' OF compatibility table entry to enable OF matches.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02 09:53:15 +00:00
Guenter Roeck 1daed9becd staging/iio: (iio_hwmon) Add support for sysfs name attribute
The 'name' attribute is mandatory for hwmon devices.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02 09:51:56 +00:00
Guenter Roeck c4ac7b98bd staging/iio: (iio_hwmon) Use devm_kzalloc
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02 09:48:34 +00:00
Lars-Peter Clausen 420b0fcb52 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>
2013-02-02 09:27:56 +00:00
Lars-Peter Clausen 53ac8500ba 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>
2013-02-02 09:24:18 +00:00
Lars-Peter Clausen d5e69c8350 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>
2013-02-02 09:24:00 +00:00
Lars-Peter Clausen 619036e216 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>
2013-02-02 09:22:48 +00:00
Lars-Peter Clausen 457b71df27 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>
2013-02-02 09:22:31 +00:00
Lars-Peter Clausen 1439b6e8d1 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>
2013-02-02 09:22:14 +00:00
Lars-Peter Clausen ceac0cf209 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>
2013-02-02 09:21:56 +00:00
Lars-Peter Clausen 9a26578c81 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>
2013-02-02 09:21:36 +00:00
Lars-Peter Clausen c62b89c713 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>
2013-02-02 09:20:56 +00:00
Lars-Peter Clausen 1a87e4fba6 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>
2013-02-02 09:20:07 +00:00
Lars-Peter Clausen 6a6df2d911 Partially revert "staging:iio:gyro:adxrs450 make more use of spi_read and spi_write."
This partially reverts commit cb4496876f. 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>
2013-02-02 09:17:26 +00:00
H Hartley Sweeten 085494ac20 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>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 39bd5e59b1 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>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 1ae6b20b88 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>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 52c9bf4cf5 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>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 8cd98c8263 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>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 2bdaef1afc 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>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 1f021e1f3b 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>
2013-01-31 10:40:41 +01:00
H Hartley Sweeten 309231d7a6 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>
2013-01-31 10:38:10 +01:00
H Hartley Sweeten 33782dd5ed 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>
2013-01-31 10:38:10 +01:00
H Hartley Sweeten abac8b54a3 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>
2013-01-31 10:35:48 +01:00
Malcolm Priestley ae5943de8c 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>
2013-01-31 10:30:45 +01:00
Peter Hurley d13b0b6d51 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>
2013-01-31 10:30:34 +01:00
Peter Hurley 1aedfa8f25 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>
2013-01-31 10:30:34 +01:00
Seth Jennings 0d145a5017 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>
2013-01-30 18:22:41 +01:00
Geert Uytterhoeven 5ccac0fd59 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>
2013-01-30 18:16:54 +01:00
Ian Abbott 682b911938 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
7d3135af39 ("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>
2013-01-30 11:47:47 +01:00
Ian Abbott 754ab5c0e5 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 7d3135af39 ("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>
2013-01-30 11:47:47 +01:00
Peter Hurley 612588a886 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>
2013-01-29 23:31:34 -05:00
Peter Hurley ef34dd184d staging/fwserial: add diagnostic for buffer overflow
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:28:45 -05:00
Peter Hurley 2257d1224f 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>
2013-01-29 23:28:45 -05:00
Peter Hurley 84472c3b58 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>
2013-01-29 23:28:45 -05:00
Peter Hurley 4df5bb0464 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>
2013-01-29 23:28:45 -05:00
Peter Hurley e16d1ded85 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>
2013-01-29 23:28:45 -05:00
Peter Hurley fa1da242c3 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>
2013-01-29 23:28:45 -05:00
Peter Hurley a3d9ad474e 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>
2013-01-29 23:28:45 -05:00
Peter Hurley c88d40b25f 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>
2013-01-29 23:28:45 -05:00
Peter Hurley de321a14da 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>
2013-01-29 23:28:44 -05:00
Peter Hurley 2b86216ba1 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>
2013-01-29 23:26:16 -05:00
Peter Hurley 9883a7396b 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>
2013-01-29 23:26:16 -05:00
Peter Hurley 3b1f315415 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>
2013-01-29 23:26:16 -05:00
Peter Hurley d83561894d staging/fwserial: Simplify max payload calculation
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:26:16 -05:00
Peter Hurley 5d110d9296 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>
2013-01-29 23:26:16 -05:00
Peter Hurley 06b8f14dc2 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>
2013-01-29 23:26:16 -05:00
Rupesh Gujare b360cb9726 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>
2013-01-29 23:25:10 -05:00
Marc Dietrich 93eff83ff1 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>
2013-01-29 23:25:10 -05:00
Marc Dietrich 85a90528b2 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>
2013-01-29 23:25:09 -05:00
Marc Dietrich 518945fbfb 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>
2013-01-29 23:25:09 -05:00
Minchan Kim 9915518887 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>
2013-01-29 23:22:16 -05:00
Peter Huewe e620096471 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>
2013-01-29 23:22:16 -05:00
Ryo Munakata 05014d73d6 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>
2013-01-29 23:22:16 -05:00
Peter Huewe 2643c47fa4 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>
2013-01-29 23:22:16 -05:00
Seth Jennings d662b8eba9 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>
2013-01-29 23:16:42 -05:00
Peter Huewe e21545449b 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>
2013-01-29 23:11:41 -05:00
Ian Abbott bc3954b814 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>
2013-01-29 23:11:41 -05:00
Ian Abbott 104640606b 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>
2013-01-29 23:11:41 -05:00
H Hartley Sweeten 12e9a5f1df 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>
2013-01-29 23:09:25 -05:00
H Hartley Sweeten 40faa60bd4 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>
2013-01-29 23:09:25 -05:00
H Hartley Sweeten 6e4733c34f 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>
2013-01-29 23:09:25 -05:00
H Hartley Sweeten 6749ffa840 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>
2013-01-29 23:09:25 -05:00
H Hartley Sweeten b2e1be03ac 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>
2013-01-29 23:09:25 -05:00
H Hartley Sweeten fdcb5fdee2 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>
2013-01-29 23:09:25 -05:00
H Hartley Sweeten 00cefaa562 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>
2013-01-29 23:09:25 -05:00
H Hartley Sweeten 4fc76ea03f 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>
2013-01-29 23:09:24 -05:00
H Hartley Sweeten deead9d973 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>
2013-01-29 23:09:24 -05:00
H Hartley Sweeten 88dd3eb4d8 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>
2013-01-29 23:09:24 -05:00
H Hartley Sweeten 098303caaf 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>
2013-01-29 23:09:24 -05:00
H Hartley Sweeten 3e6c183306 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>
2013-01-29 23:09:24 -05:00
H Hartley Sweeten 885d8bce7f 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten 678a6ff3e9 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten 616b7a479e 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten abbe0796ba 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten aaefe848e0 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten e5e7ff89e6 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten 1b69a7577a 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten bea5b9035d 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>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten 63e563af82 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>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten b8f4c930e0 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>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten a7538b8271 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>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten 27629c600d 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>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten b7c0afa4b6 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>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten c65c64d0f0 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>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten e23fe9a1bf 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>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten 7b947d6116 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>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten 79a53df7fa 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>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten 90967d6626 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>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten b8319710de 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>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten cdcc02291b 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>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten 86be5680f5 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>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten d1db2a4134 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>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten 433a0e2213 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>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten 04c5904155 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>
2013-01-29 23:06:40 -05:00
David S. Miller f1e7b73acc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Bring in the 'net' tree so that we can get some ipv4/ipv6 bug
fixes that some net-next work will build upon.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-29 15:32:13 -05:00
Jiri Kosina 617677295b Merge branch 'master' into for-next
Conflicts:
	drivers/devfreq/exynos4_bus.c

Sync with Linus' tree to be able to apply patches that are
against newer code (mvneta).
2013-01-29 10:48:30 +01:00
Prashant Gaikwad 1e54f0a21e staging: nvec: remove use of clk_get_sys
As clock information is added to device tree clock can be looked up
using clk_get. Remove use of clk_get_sys.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Acked-by: Julian Andres Klode <jak@jak-linux.org>
[swarren: updated TODO file to remove entry that requested this change]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2013-01-28 11:19:33 -07:00