platform/kernel/linux-3.10.git
12 years agostaging: comedi: me4000: remove inline port io wrappers
H Hartley Sweeten [Thu, 14 Jun 2012 02:12:55 +0000 (19:12 -0700)]
staging: comedi: me4000: remove inline port io wrappers

With the PORT_PDEBUG macro remove we can now remove the inline
port io wrappers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me4000: remove PORT_PDEBUG macro
H Hartley Sweeten [Thu, 14 Jun 2012 02:12:35 +0000 (19:12 -0700)]
staging: comedi: me4000: remove PORT_PDEBUG macro

The PORT_PDEBUG macro is used to output the result of every port
io operation. This shouldn't be in a mainline driver. Remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me4000: remove CALL_PDEBUG macro
H Hartley Sweeten [Thu, 14 Jun 2012 02:12:18 +0000 (19:12 -0700)]
staging: comedi: me4000: remove CALL_PDEBUG macro

The CALL_PDEBUG macro is used to do function tracing in the driver.
There are better ways to do this. Remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: pcl812: remove PCL812_EXTDEBUG define and related code
H Hartley Sweeten [Thu, 14 Jun 2012 01:22:07 +0000 (18:22 -0700)]
staging: comedi: pcl812: remove PCL812_EXTDEBUG define and related code

The PCL812_EXTDEBUG define enables a bunch of function tracing debug
messages as well as a dump of the comedi_cmd info during the cmdtest.
There are better ways to do the function tracing and the cmdtest
dump shouldn't be in the driver. Just remove all of it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: pcl812: remove unneeded tests in pcl812_ai_cmdtest
H Hartley Sweeten [Thu, 14 Jun 2012 00:58:07 +0000 (17:58 -0700)]
staging: comedi: pcl812: remove unneeded tests in pcl812_ai_cmdtest

The step 2 tests to make sure that the triggers are unique is not
needed for single source triggers. These were already trivially
validated in step 1.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: pcl818: remove unneeded tests in ai_cmdtest
H Hartley Sweeten [Thu, 14 Jun 2012 00:41:35 +0000 (17:41 -0700)]
staging: comedi: pcl818: remove unneeded tests in ai_cmdtest

The step 2 tests of the start_src, scan_begin_src, and scan_end_src
triggers to make sure they are unique are not needed.  These triggers
all only have one source and it was trivially validated in step 1.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: pcl816: remove unneeded tests in pcl816_ai_cmdtest
H Hartley Sweeten [Thu, 14 Jun 2012 00:50:53 +0000 (17:50 -0700)]
staging: comedi: pcl816: remove unneeded tests in pcl816_ai_cmdtest

The step 2 tests of the start_src, scan_begin_src, and scan_end_src
triggers to make sure they are unique are not needed.  These triggers
all only have one source and it was trivially validated in step 1.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: ni_atmio16d: remove the function tracing debug
H Hartley Sweeten [Thu, 14 Jun 2012 01:09:51 +0000 (18:09 -0700)]
staging: comedi: ni_atmio16d: remove the function tracing debug

These printk's are #ifdef'ed out with an undefined symbol anyway.
Just remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zcache: don't limit number of pools per client
Sasha Levin [Wed, 6 Jun 2012 19:05:48 +0000 (21:05 +0200)]
staging: zcache: don't limit number of pools per client

Currently the amount of pools each client can use is limited to 16, this is
and arbitrary limit which isn't really required by current implementation.

This places and arbitrary limit on the number of mounted filesystems that
can use cleancache.

This patch removes that limit and uses IDR to do sparse mapping of pools
in each client.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: usbip: cleanup and fix of vhci_hub_status
Bart Westgeest [Wed, 13 Jun 2012 19:37:18 +0000 (15:37 -0400)]
staging: usbip: cleanup and fix of vhci_hub_status

Changed setting the status bits to a byte-oriented approach. Number of
written status bits is now based on VHCI_NPORT, instead of casting
status buffer to a long. This fixes a stack corruption bug on 64-bit
based architectures, and potential byte order / endianness related
issues.

In addition updated function comments, and log statements.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zsmalloc: fix uninit'ed variable warning
Seth Jennings [Wed, 13 Jun 2012 21:03:42 +0000 (16:03 -0500)]
staging: zsmalloc: fix uninit'ed variable warning

This patch fixes an uninitialized variable warning in
alloc_zspage().  It also fixes the secondary issue of
prev_page leaving scope on each loop iteration.  The only
reason this ever worked was because prev_page was occupying
the same space on the stack on each iteration.

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: add some whitespace to the #define's
H Hartley Sweeten [Wed, 13 Jun 2012 22:43:11 +0000 (15:43 -0700)]
staging: comedi: 8255: add some whitespace to the #define's

Add whitespace to the _8255_* defines to improve readability.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: add namespace to 'do_config' function
H Hartley Sweeten [Wed, 13 Jun 2012 22:43:04 +0000 (15:43 -0700)]
staging: comedi: 8255: add namespace to 'do_config' function

The name 'do_config' is pretty generic, and this function is the
only one in this driver without namespace. Add namespace to it
just to avoid any issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: move the subdev_8255_io function
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:51 +0000 (15:42 -0700)]
staging: comedi: 8255: move the subdev_8255_io function

The subdev_8255_interrupt function indirectly calls subdev_8255_io.
For aesthetic reasons, move the subdev_8255_io function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: refactor subdev_8255_insn function
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:45 +0000 (15:42 -0700)]
staging: comedi: 8255: refactor subdev_8255_insn function

Refactor the subdev_8255_insn function to follow what the user
space library is doing.

1) This function requires 'data' to contain 2 parameters. Add a
sanity check for this (insn->n != 2).

2) The 'data' parameters are actually a 'mask' of the valid bits and
the actual 'bits' to modify. Create local variables of these names
to help with maintainability.

3) The value returned in data[1] reflects the actual state of the
8255 io pins after the update of the masked bits. Fetch this data
in a local variable and then set data[1].

4) The user space library only checks for a < 0 return to indicate
an error. It appears that the 'return 2' in this function is supposed
to indicate the number of data parameters used to perform the command.
Return the insn->n value for this, the open coded '2' looks wrong.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Iam Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: use a local variable for the iobase
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:39 +0000 (15:42 -0700)]
staging: comedi: 8255: use a local variable for the iobase

To improve readability, use a locale variable to hold the 8255's
private iobase value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: use kzalloc to allocate the private data
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:34 +0000 (15:42 -0700)]
staging: comedi: 8255: use kzalloc to allocate the private data

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: check for failure of subdev_8255_init
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:28 +0000 (15:42 -0700)]
staging: comedi: 8255: check for failure of subdev_8255_init

The initialization of the 8255 subdevice can fail. Make sure to
check for it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: remove have_irg and refactor subdev_8255_init_irq
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:21 +0000 (15:42 -0700)]
staging: comedi: 8255: remove have_irg and refactor subdev_8255_init_irq

The have_irq variable in the 8255 private data is not used by the driver,
remove it.  This removes the need to access the private data in the
subdev_8255_init_irq function.

Also, add a bit of whitespace to improve the readability.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: refactor subdev_8255_init
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:12 +0000 (15:42 -0700)]
staging: comedi: 8255: refactor subdev_8255_init

Refactor the initialization of the 8255 so that the private data
allocation is done before the subdevice is setup. This makes sure
that the setup is complete.

Also, add a bit of whitespace to improve the readability.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: push out the 8255's private data variable rename
H Hartley Sweeten [Wed, 13 Jun 2012 22:42:02 +0000 (15:42 -0700)]
staging: comedi: 8255: push out the 8255's private data variable rename

Push out the rename of the private variables to improve the readability
of the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: rename cb_arg and cb_func
H Hartley Sweeten [Wed, 13 Jun 2012 22:41:54 +0000 (15:41 -0700)]
staging: comedi: 8255: rename cb_arg and cb_func

The 8255's private data variables cb_arg and cb_func are actually
the iobase for the 8255 device and the pointer to the io function
to access the device. Rename them as such to improve the readability
of the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: remove the s->private access macros
H Hartley Sweeten [Wed, 13 Jun 2012 22:41:45 +0000 (15:41 -0700)]
staging: comedi: 8255: remove the s->private access macros

The macros CALLBACK_ARG, CALLBACK_FUNC, and subdevpriv all rely
on a a local variable having a specific name. Replace the macros
with local variables wherever they occur.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: rename the private data structure
H Hartley Sweeten [Wed, 13 Jun 2012 22:41:36 +0000 (15:41 -0700)]
staging: comedi: 8255: rename the private data structure

Rename the 8255's private data structure from subdev_8255_struct
to subdev_8255_private.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: use pointer to dev->subdevices
H Hartley Sweeten [Wed, 13 Jun 2012 22:41:27 +0000 (15:41 -0700)]
staging: comedi: 8255: use pointer to dev->subdevices

Instead of accessing the dev->subdevices directly as an array,
use a pointer. This method is more common in the comedi subsystem.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: 8255: replace printk calls
H Hartley Sweeten [Wed, 13 Jun 2012 22:41:15 +0000 (15:41 -0700)]
staging: comedi: 8255: replace printk calls

Replace the printk calls with dev_info, dev_warn, etc.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Cleanup vb_device_info struct
Peter Huewe [Wed, 13 Jun 2012 22:21:52 +0000 (00:21 +0200)]
staging/xgifb: Cleanup vb_device_info struct

This patch cleans up the vb_device_info struct and the related
functions.
The cleanup decreases the size of the compiled module by
about 10kB.

== Remove fields in vb_device_info that are never read: ==
pOutputSelect
pRGBSenseData
pRGBSenseData2
pVideoSenseData
pVideoSenseData2
pYCSenseData
pYCSenseData2
CR49
pXGINew_I2CDefinition
pCR2E
pCR2F
pCR46
pCR47
pCRD0
pCRDE
pSR40
pSR41
pCR47

=== Remove the corresponding 'constants' ===
XGI330_RGBSenseData
XGI330_RGBSenseData2
XGI330_VideoSenseData
XGI330_VideoSenseData2
XGI330_YCSenseData
XGI330_YCSenseData2
XGI330_CR49
XG40_I2CDefinition
XG21_CR2E
XG21_CR2F
XG21_CR46
XG21_CR47
XG27_CRD0
XG27_CRDE
XGI330_OutputSelect

== Remove 'constant fields' and replace constant value with #define ==
pSR07 = XGI330_SR07 -> 0x18
pSR1F = XGI330_SR1F -> 0
pSR23 = XGI330_SR23 -> 0xf6
pSR24 = XGI330_SR24 -> 0x0d
pSR33 = XGI330_SR33 ->0
pCRT2Data_1_2 = XGI330_CRT2Data_1_2 -> 0
pCRT2Data_4_D = XGI330_CRT2Data_4_D -> 0
pCRT2Data_4_E = XGI330_CRT2Data_4_E -> 0
pCRT2Data_4_10 = XGI330_CRT2Data_4_10 -> 0x80
pSR36 = XG27_SR36 -> 0x30
pCR8F = &XG27_CR8F -> 0x0C
pSR40 = XG27_SR40 -> 0x04
pSR41 = XG27_SR41 ->0x00
pSR31 = XGI330_SR31 -> 0xc0
pSR32 = XGI330_SR32 -> 0xc0
SR25 = XGI330_sr25 -> 0 (we only use XGI330_sr25[0])

== Constant fields with 'dead' code: ==
pSoftSetting is set to XGI330_SoftSetting = 0x30
-> if (*pVBInfo->pSoftSetting & SoftDRAMType) is never true since
SoftDRAMType = 0x80
-> if (*pVBInfo->pSoftSetting & ModeSoftSetting) is never true since
ModeSoftSetting = 0x04
--> remove the code, remove pSoftSetting, remove XGI330_SoftSetting

pDVOSetting is set to XG21_DVOSetting = 0
-> if (((*pVBInfo->pDVOSetting) & 0xC0) == 0xC0) is never true
--> remove the code, remove pDVOSetting, remove XG21_DVOSetting

pXGINew_DRAMTypeDefinition is set to &XG40_DRAMTypeDefinition 0xFF
-> if (*pVBInfo->pXGINew_DRAMTypeDefinition != 0x0C) is always true
--> remove the if and remove pXGINew_DRAMTypeDefinition
remove XG40_DRAMTypeDefinition

== Replace pointer to unsigned char with unsigned char variable
and assign value of referenced pointer: ==
pSR21 -> SR21, remove XGI330_SR21
pSR22 -> SR22, remove XGI330_SR22
pXGINew_CR97 -> XGINew_CR97, remove XG20_CR97, XG27_CR97 and Z11m_CR97

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Use SiS structs
Peter Huewe [Wed, 13 Jun 2012 22:21:51 +0000 (00:21 +0200)]
staging/xgifb: Use SiS structs

This patch replaces some of the XGI internal structs by their
counterparts in the SiS driver.
XGI330_LVDSDataStruct -> SiS_LVDSData
XGI330_LCDDataStruct -> SiS_LCDData
XGI330_CHTVDataStruct -> SiS_LVDSData

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Replace delay lookup tables with constant values
Peter Huewe [Wed, 13 Jun 2012 22:21:50 +0000 (00:21 +0200)]
staging/xgifb: Replace delay lookup tables with constant values

For TV Devices:
The values taken from XGI_TVDelayList are always overwritten with the
values from XGI_TVDelayList2 since the if condition for using the values
from XGI_TVDelayList2 is identical with the check to enter this scope and
thus always true.
The delay values in XGI_TVDelayList2 is always 0x22 so we
can simply replace it with this constant value.

For LCD Devices:
The LCD_DelayCompensation field is always set to 0x12 so we can simply
replace this field with a constant value.

This saves about 500 bytes in compiled size.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Remove useless function XGI_CloseCRTC
Peter Huewe [Wed, 13 Jun 2012 22:21:49 +0000 (00:21 +0200)]
staging/xgifb: Remove useless function XGI_CloseCRTC

Since XGI_CloseCRTC does not perform anything useful we can simply
remove it.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Simplyfy XGI_GetVCLK2Ptr a bit
Peter Huewe [Wed, 13 Jun 2012 22:21:48 +0000 (00:21 +0200)]
staging/xgifb: Simplyfy XGI_GetVCLK2Ptr a bit

This patch simplyfies the XGI_GetVCLK2Ptr a bit by moving the +=25 to
a define and removing statements without effect.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Replace constant arrays with constant values
Peter Huewe [Wed, 13 Jun 2012 22:21:47 +0000 (00:21 +0200)]
staging/xgifb: Replace constant arrays with constant values

This patch removes the arrays in XGI_GetVCLK2Ptr which each contain only
one value four times and replaces them with their constant value.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Remove unnecessary fields of XGINew_DDRDRAM_TYPE{340, 20}
Peter Huewe [Wed, 13 Jun 2012 22:21:46 +0000 (00:21 +0200)]
staging/xgifb: Remove unnecessary fields of XGINew_DDRDRAM_TYPE{340, 20}

Since the first three entries in XGINew_DDRDRAM_TYPE{340,20} are never
used, we can simply remove them;
and instead of passing XGINew_DDRDRAM_TYPE with an index we can simply
pass the value directly to XGINew_SetDRAMSize20Reg.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Inline XGINew_SetDRAMSizingType
Peter Huewe [Wed, 13 Jun 2012 22:21:45 +0000 (00:21 +0200)]
staging/xgifb: Inline XGINew_SetDRAMSizingType

Since the function XGINew_SetDRAMSizingType is only called from one
location and consist only of 2 valuable lines we can simply inline it
here.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Remove duplicated code from XGINew_DDRSizing340
Peter Huewe [Wed, 13 Jun 2012 22:21:44 +0000 (00:21 +0200)]
staging/xgifb: Remove duplicated code from XGINew_DDRSizing340

Since XGINew_SetDRAMSize20Reg now handles both cases we can remove
the code duplication in XGINew_DDRSizing340.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Consolidate XGINew_SetDRAMSize{,20}Reg
Peter Huewe [Wed, 13 Jun 2012 22:21:43 +0000 (00:21 +0200)]
staging/xgifb: Consolidate XGINew_SetDRAMSize{,20}Reg

This patch consolidates the almost identical functions
XGINew_SetDRAMSizeReg and XGINew_SetDRAMSize20Reg as they are
implemented identically except one division factor.

The changed factor is now reflected in the input data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Remove superfluous header includes
Peter Huewe [Wed, 13 Jun 2012 22:21:42 +0000 (00:21 +0200)]
staging/xgifb: Remove superfluous header includes

This patch removes all unnecessary, redundant and superfluous header
includes from xgifb.

Tested on hp t5325 (XGI Z11)

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Add header #include guards to vb_table.h
Peter Huewe [Wed, 13 Jun 2012 22:21:41 +0000 (00:21 +0200)]
staging/xgifb: Add header #include guards to vb_table.h

This patch adds a simple #include guard to vb_table.h

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Add mutext for fb_mmap locking
Peter Huewe [Wed, 13 Jun 2012 22:21:40 +0000 (00:21 +0200)]
staging/xgifb: Add mutext for fb_mmap locking

This adds a mutex for fb_mmap around smem_start and smem_len
so the mutex inside the fb_mmap() is actually used.  Changing of
these fields before calling the framebuffer_register() are not mutexed.

We check whether framebuffer_register has been called by reading
fbinfo->count.

See 537a1bf0 - "fbdev: add mutex for fb_mmap locking" by Krzysztof Helt
for details.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/xgifb: Remove assignments without effect
Peter Huewe [Wed, 13 Jun 2012 22:21:39 +0000 (00:21 +0200)]
staging/xgifb: Remove assignments without effect

This patch removes assignments to the fb_fix_screeninfo struct which are
overwritten by the memset in XGIfb_get_fix() a few lines later.
Since the name/id might be useful this was moved to XGIfb_get_fix().

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/android: Remove ram_console driver
Anton Vorontsov [Sat, 26 May 2012 13:20:26 +0000 (06:20 -0700)]
staging/android: Remove ram_console driver

All the functionality is now supported by pstore and pstore_ram drivers.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/platform: Disable automatic updates by default
Anton Vorontsov [Sat, 26 May 2012 13:20:29 +0000 (06:20 -0700)]
pstore/platform: Disable automatic updates by default

Having automatic updates seems pointless for production system, and
even dangerous and thus counter-productive:

1. If we can mount pstore, or read files, we can as well read
   /proc/kmsg. So, there's little point in duplicating the
   functionality and present the same information but via another
   userland ABI;

2. Expecting the kernel to behave sanely after oops/panic is naive.
   It might work, but you'd rather not try it. Screwed up kernel
   can do rather bad things, like recursive faults[1]; and pstore
   rather provoking bad things to happen. It uses:

   1. Timers (assumes sane interrupts state);
   2. Workqueues and mutexes (assumes scheduler in a sane state);
   3. kzalloc (a working slab allocator);

   That's too much for a dead kernel, so the debugging facility
   itself might just make debugging harder, which is not what
   we want.

Maybe for non-oops message types it would make sense to re-enable
automatic updates, but so far I don't see any use case for this.
Even for tracing, it has its own run-time/normal ABI, so we're
only interested in pstore upon next boot, to retrieve what has
gone wrong with HW or SW.

So, let's disable the updates by default.

[1]
BUG: unable to handle kernel paging request at fffffffffffffff8
IP: [<ffffffff8104801b>] kthread_data+0xb/0x20
[...]
Process kworker/0:1 (pid: 14, threadinfo ffff8800072c0000, task ffff88000725b100)
[...
Call Trace:
 [<ffffffff81043710>] wq_worker_sleeping+0x10/0xa0
 [<ffffffff813687a8>] __schedule+0x568/0x7d0
 [<ffffffff8106c24d>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffff81087e22>] ? call_rcu_sched+0x12/0x20
 [<ffffffff8102b596>] ? release_task+0x156/0x2d0
 [<ffffffff8102b45e>] ? release_task+0x1e/0x2d0
 [<ffffffff8106c24d>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffff81368ac4>] schedule+0x24/0x70
 [<ffffffff8102cba8>] do_exit+0x1f8/0x370
 [<ffffffff810051e7>] oops_end+0x77/0xb0
 [<ffffffff8135c301>] no_context+0x1a6/0x1b5
 [<ffffffff8135c4de>] __bad_area_nosemaphore+0x1ce/0x1ed
 [<ffffffff81053156>] ? ttwu_queue+0xc6/0xe0
 [<ffffffff8135c50b>] bad_area_nosemaphore+0xe/0x10
 [<ffffffff8101fa47>] do_page_fault+0x2c7/0x450
 [<ffffffff8106e34b>] ? __lock_release+0x6b/0xe0
 [<ffffffff8106bf21>] ? mark_held_locks+0x61/0x140
 [<ffffffff810502fe>] ? __wake_up+0x4e/0x70
 [<ffffffff81185f7d>] ? trace_hardirqs_off_thunk+0x3a/0x3c
 [<ffffffff81158970>] ? pstore_register+0x120/0x120
 [<ffffffff8136a37f>] page_fault+0x1f/0x30
 [<ffffffff81158970>] ? pstore_register+0x120/0x120
 [<ffffffff81185ab8>] ? memcpy+0x68/0x110
 [<ffffffff8115875a>] ? pstore_get_records+0x3a/0x130
 [<ffffffff811590f4>] ? persistent_ram_copy_old+0x64/0x90
 [<ffffffff81158bf4>] ramoops_pstore_read+0x84/0x130
 [<ffffffff81158799>] pstore_get_records+0x79/0x130
 [<ffffffff81042536>] ? process_one_work+0x116/0x450
 [<ffffffff81158970>] ? pstore_register+0x120/0x120
 [<ffffffff8115897e>] pstore_dowork+0xe/0x10
 [<ffffffff81042594>] process_one_work+0x174/0x450
 [<ffffffff81042536>] ? process_one_work+0x116/0x450
 [<ffffffff81042e13>] worker_thread+0x123/0x2d0
 [<ffffffff81042cf0>] ? manage_workers.isra.28+0x120/0x120
 [<ffffffff81047d8e>] kthread+0x8e/0xa0
 [<ffffffff8136ba74>] kernel_thread_helper+0x4/0x10
 [<ffffffff8136a199>] ? retint_restore_args+0xe/0xe
 [<ffffffff81047d00>] ? __init_kthread_worker+0x70/0x70
 [<ffffffff8136ba70>] ? gs_change+0xb/0xb
Code: be e2 00 00 00 48 c7 c7 d1 2a 4e 81 e8 bf fb fd ff 48 8b 5d f0 4c 8b 65 f8 c9 c3 0f 1f 44 00 00 48 8b 87 08 02 00 00 55 48 89 e5 <48> 8b 40 f8 5d c3 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00
RIP  [<ffffffff8104801b>] kthread_data+0xb/0x20
 RSP <ffff8800072c1888>
CR2: fffffffffffffff8
---[ end trace 996a332dc399111d ]---
Fixing recursive fault but reboot is needed!

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/platform: Make automatic updates interval configurable
Anton Vorontsov [Sat, 26 May 2012 13:20:28 +0000 (06:20 -0700)]
pstore/platform: Make automatic updates interval configurable

There is no behavioural change, the default value is still 60 seconds.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram_core: Remove now unused code
Anton Vorontsov [Sat, 26 May 2012 13:20:27 +0000 (06:20 -0700)]
pstore/ram_core: Remove now unused code

The code tried to maintain the global list of persistent ram zones,
which isn't a great idea overall, plus since Android's ram_console
is no longer there, we can remove some unused functions.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Add some more documentation and examples
Anton Vorontsov [Sat, 26 May 2012 13:20:25 +0000 (06:20 -0700)]
pstore/ram: Add some more documentation and examples

Suggested-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram_core: Silence some printks
Anton Vorontsov [Sat, 26 May 2012 13:20:24 +0000 (06:20 -0700)]
pstore/ram_core: Silence some printks

Since we use multiple regions, the messages are somewhat annoying.
We do print total mapped memory already, so no need to print the
information for each region in the library routines.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Add console messages handling
Anton Vorontsov [Sat, 26 May 2012 13:20:23 +0000 (06:20 -0700)]
pstore/ram: Add console messages handling

The console log size is configurable via ramoops.console_size
module option, and the log itself is available via
<pstore-mount>/console-ramoops file.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Factor ramoops_get_next_prz() out of ramoops_pstore_read()
Anton Vorontsov [Sat, 26 May 2012 13:20:22 +0000 (06:20 -0700)]
pstore/ram: Factor ramoops_get_next_prz() out of ramoops_pstore_read()

This will help make code clearer when we'll add support for other
message types.

The patch also changes return value from -EINVAL to 0 in case of
end-of-records. The exact value doesn't matter for pstore (it should
be just <= 0), but 0 feels more correct.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Factor dmesg przs initialization out of probe()
Anton Vorontsov [Sat, 26 May 2012 13:20:21 +0000 (06:20 -0700)]
pstore/ram: Factor dmesg przs initialization out of probe()

This will help make code clearer when we'll add support for other
message types.

This also makes probe() much shorter and understandable, plus
makes mem/record size checking a bit easier.

Implementation detail: we now use a paddr pointer, this will
be used for allocating persistent ram zones for other message
types.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Give proper names to dump-related variables
Anton Vorontsov [Sat, 26 May 2012 13:20:20 +0000 (06:20 -0700)]
pstore/ram: Give proper names to dump-related variables

We're about to add support for other message types, so let's rename
some variables to not be confused later.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore: Add console log messages support
Anton Vorontsov [Sat, 26 May 2012 13:20:19 +0000 (06:20 -0700)]
pstore: Add console log messages support

Pstore doesn't support logging kernel messages in run-time, it only
dumps dmesg when kernel oopses/panics. This makes pstore useless for
debugging hangs caused by HW issues or improper use of HW (e.g.
weird device inserted -> driver tried to write a reserved bits ->
SoC hanged. In that case we don't get any messages in the pstore.

Therefore, let's add a runtime logging support: PSTORE_TYPE_CONSOLE.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoMerge branch 'staging-linus' into staging-next
Greg Kroah-Hartman [Wed, 13 Jun 2012 23:57:09 +0000 (16:57 -0700)]
Merge branch 'staging-linus' into staging-next

We need this for the pstore fixes that went into the staging-linus branch, so
that things apply properly for the pstore/android code merge.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/inode: Make pstore_fill_super() static
Anton Vorontsov [Sat, 26 May 2012 13:07:53 +0000 (06:07 -0700)]
pstore/inode: Make pstore_fill_super() static

There's no reason to extern it. The patch fixes the annoying sparse
warning:

CHECK   fs/pstore/inode.c
fs/pstore/inode.c:264:5: warning: symbol 'pstore_fill_super' was not
declared. Should it be static?

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Should zap persistent zone on unlink
Anton Vorontsov [Sat, 26 May 2012 13:07:52 +0000 (06:07 -0700)]
pstore/ram: Should zap persistent zone on unlink

Otherwise, unlinked file will reappear on the next boot.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram_core: Factor persistent_ram_zap() out of post_init()
Anton Vorontsov [Sat, 26 May 2012 13:07:51 +0000 (06:07 -0700)]
pstore/ram_core: Factor persistent_ram_zap() out of post_init()

A handy function that we will use outside of ram_core soon. But
so far just factor it out and start using it in post_init().

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram_core: Do not reset restored zone's position and size
Anton Vorontsov [Sat, 26 May 2012 13:07:50 +0000 (06:07 -0700)]
pstore/ram_core: Do not reset restored zone's position and size

Otherwise, the files will survive just one reboot, and on a subsequent
boot they will disappear.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Should update old dmesg buffer before reading
Anton Vorontsov [Sat, 26 May 2012 13:07:49 +0000 (06:07 -0700)]
pstore/ram: Should update old dmesg buffer before reading

Without the update, we'll only see the new dmesg buffer after the
reboot, but previously we could see it right away. Making an oops
visible in pstore filesystem before reboot is a somewhat dubious
feature, but removing it wasn't an intentional change, so let's
restore it.

For this we have to make persistent_ram_save_old() safe for calling
multiple times, and also extern it.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: android: alarm: remove unnecessary goto statement
Devendra Naga [Sat, 19 May 2012 18:53:26 +0000 (00:23 +0530)]
staging: android: alarm: remove unnecessary goto statement

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: Kconfig: cleanup depends on logic
H Hartley Sweeten [Wed, 13 Jun 2012 00:37:10 +0000 (17:37 -0700)]
staging: comedi: Kconfig: cleanup depends on logic

All of the config options for comedi depend on COMEDI being
selected. Wrap everything in an 'if COMEDI/endif' block and
remove all the individual 'depends on COMEDI' in the Kconfig.

Also, remove the redundant && ISA/PCI/PCMCIA/USB for the if
blocks with those driver types.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: speakup: fixed checkpatch and sparse warnings in selection.c
Chris Yungmann [Wed, 13 Jun 2012 16:39:55 +0000 (12:39 -0400)]
staging: speakup: fixed checkpatch and sparse warnings in selection.c

Signed-off-by: Chris Yungmann <yungmann.chris@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: keucr: scsiglue: fixed a do while coding style issue
William Blair [Wed, 13 Jun 2012 05:16:49 +0000 (01:16 -0400)]
Staging: keucr: scsiglue: fixed a do while coding style issue

Added a do ... while (0) to a multi statement macro and reformatted a similar macro.

Signed-off-by: William Blair <wdblair@bu.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging bcm: spelling of suppress in code
Peter Meerwald [Wed, 13 Jun 2012 18:44:35 +0000 (20:44 +0200)]
staging bcm: spelling of suppress in code

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging bcm: spelling of suppress in comments
Peter Meerwald [Wed, 13 Jun 2012 18:44:34 +0000 (20:44 +0200)]
staging bcm: spelling of suppress in comments

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: remove check for PCI_SUPPORT_VER1
H Hartley Sweeten [Tue, 12 Jun 2012 22:58:29 +0000 (15:58 -0700)]
staging: comedi: remove check for PCI_SUPPORT_VER1

This symbol is not defined in the kernel. It appears to be left
over from the 2.4 kernel.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: cleanup iio/iio.h
Peter Meerwald [Tue, 12 Jun 2012 13:38:48 +0000 (15:38 +0200)]
iio: cleanup iio/iio.h

indentation of parameter description,
fix parameter name (@dev -> @indio_dev) in comments,
IIO device info structure -> IIO device structure

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: mark struct iio_enum elements with @ in comment
Peter Meerwald [Tue, 12 Jun 2012 13:38:47 +0000 (15:38 +0200)]
iio: mark struct iio_enum elements with @ in comment

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: clarify channel and indexed in struct iio_chan_spec
Peter Meerwald [Tue, 12 Jun 2012 13:38:46 +0000 (15:38 +0200)]
iio: clarify channel and indexed in struct iio_chan_spec

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: fix typos in iio.h
Peter Meerwald [Tue, 12 Jun 2012 13:38:45 +0000 (15:38 +0200)]
iio: fix typos in iio.h

v2:
* "used in in-kernel" (Jonathan Cameron)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: nitpicking on sysfs-bus-iio
Peter Meerwald [Tue, 12 Jun 2012 13:31:27 +0000 (15:31 +0200)]
iio: nitpicking on sysfs-bus-iio

v2: address comments by Jonathan Cameron
* add more output power down modes
* spelling of etc.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: drop comment about 'real' channels
Peter Meerwald [Tue, 12 Jun 2012 12:39:37 +0000 (14:39 +0200)]
iio: drop comment about 'real' channels

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: ad9523: Fix argument type mismatch
Michael Hennerich [Mon, 11 Jun 2012 07:51:04 +0000 (09:51 +0200)]
iio: ad9523: Fix argument type mismatch

drivers/iio/frequency/ad9523.c:378 ad9523_vco_out_map()
 warn: value 2 can't fit into 1 'out'

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: add mcp4725 I2C DAC driver
Peter Meerwald [Fri, 8 Jun 2012 16:06:45 +0000 (18:06 +0200)]
iio: add mcp4725 I2C DAC driver

v5:
* fix warnings (Jonathan Cameron)

v4:
* remove unused indio_dev pointer in mcp4725_data (Jonathan Cameron)
* use u16 instead of unsigned short in mcp4725_data (Jonathan Cameron)
* #include mcp4725.h from linux/iio/dac/

v3:
* move from staging to drivers/iio
* switch to chan_spec
* dev_get_drvdata() -> dev_to_iio_dev()
* annotate probe() and remove() with __devinit and __devexit

v2 (based on comments from Jonathan Cameron and Lars-Peter Clausen):
* did NOT switch to chan_spec yet
* rebase to staging-next tree, update iio header locations
* dropped dac.h #include, not needed
* strict_strtol() -> kstrtol()
* call iio_device_unregister() in remove()
* everything in one patch

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: frequency: adf4350: using an uninitialized variable
Dan Carpenter [Fri, 8 Jun 2012 06:54:32 +0000 (09:54 +0300)]
iio: frequency: adf4350: using an uninitialized variable

GCC complains that we use an uninitialized variable if the user passes
an invalid parameter to adf4350_read().  I decided that we should return
-EINVAL instead in that case.

However, when I looked up at adf4350_write() it returned -ENODEV for
that condition.  In the end, I decided the -EINVAL was the right thing
and I change adf4350_write() to match.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: frequency: adf4350: fix an initialization
Dan Carpenter [Fri, 8 Jun 2012 06:55:37 +0000 (09:55 +0300)]
iio: frequency: adf4350: fix an initialization

Sparse complains about this:
drivers/iio/frequency/adf4350.c:58:29: warning: Initializer entry defined twice
drivers/iio/frequency/adf4350.c:59:10:   also defined here

It looks like '|' was intended here instead of ','.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: max517: mark probe() and remove() with __devinit and __devexit
Peter Meerwald [Fri, 8 Jun 2012 06:54:18 +0000 (08:54 +0200)]
iio: max517: mark probe() and remove() with __devinit and __devexit

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Roland Stigge <stigge@antcom.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: remove indio_dev pointer from max517_data
Peter Meerwald [Fri, 8 Jun 2012 06:54:17 +0000 (08:54 +0200)]
iio: remove indio_dev pointer from max517_data

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Roland Stigge <stigge@antcom.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: frequency: ad9523: unlock on error in ad9523_reg_access()
Dan Carpenter [Fri, 8 Jun 2012 06:54:03 +0000 (09:54 +0300)]
iio: frequency: ad9523: unlock on error in ad9523_reg_access()

There was a return path which got missed accidentally.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cleanup comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:59:55 +0000 (11:59 -0700)]
staging: comedi: cleanup comedi_alloc_subdevices

Access the individual comedi_subdevices using a pointer instead
of directly accessing as an array. This is how the rest of the
comedi core accesses them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: propogate error code from comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:59:33 +0000 (11:59 -0700)]
staging: comedi: propogate error code from comedi_alloc_subdevices

comedi_alloc_subdevices can fail with -EINVAL or -ENOMEM. When it
does fail make sure to pass the proper error code back.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: remove the "Allocate the subdevice..." comments
H Hartley Sweeten [Tue, 12 Jun 2012 18:59:15 +0000 (11:59 -0700)]
staging: comedi: remove the "Allocate the subdevice..." comments

These comments are redundant. The function name 'comedi_alloc_subdevices'
provides this information.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <ian@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: remove the comed_alloc_subdevices "allocation failed" messages
H Hartley Sweeten [Tue, 12 Jun 2012 18:58:45 +0000 (11:58 -0700)]
staging: comedi: remove the comed_alloc_subdevices "allocation failed" messages

Remove all the "allocation failed" debug messages that are displayed
when the comedi_alloc_subdevices call fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbot <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: only set dev->n_subdevices when kcalloc succeedes
H Hartley Sweeten [Tue, 12 Jun 2012 18:58:27 +0000 (11:58 -0700)]
staging: comedi: only set dev->n_subdevices when kcalloc succeedes

It's possible for the kcalloc in comedi_alloc_subdevices to fail.
Only set the dev->n_subdevices variable if the allocation is
successful.

Since the core sets dev->n_subdevices, remove all the places in the
drivers where this variable was getting set.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: sanity check num_subdevices parameter in comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:57:45 +0000 (11:57 -0700)]
staging: comedi: sanity check num_subdevices parameter in comedi_alloc_subdevices

It's possible for a couple of the comedi drivers to incorrectly call
comedi_alloc_subdevices with num_subdevices = 0. Add a sanity check
before doing the kcalloc.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbot@mev.co.uk>
Cc: Frank Mori Hess <kmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: change type of num_subdevices parameter to comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:57:27 +0000 (11:57 -0700)]
staging: comedi: change type of num_subdevices parameter to comedi_alloc_subdevices

The n_subdevices variable of struct comedi_device is an int type.
Change the type of the comedi_alloc_subdevices 'num_subdevices' from
an unsigned int to an int to match it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: gdm72xx: Simplify spinlock fix for gdm_usb_send_complete
Ben Chan [Tue, 12 Jun 2012 18:23:32 +0000 (11:23 -0700)]
staging: gdm72xx: Simplify spinlock fix for gdm_usb_send_complete

This patch simplifies the previous patch (commit
dd13c86b0dae86efdde98119ffd7348e80719ade) for fixing the spinlock
recursion issue on several call sites of gdm_usb_send_complete.

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: Android: Fix NULL pointer related warning in alarm-dev.c file
Sachin Kamat [Tue, 5 Jun 2012 09:35:13 +0000 (15:05 +0530)]
staging: Android: Fix NULL pointer related warning in alarm-dev.c file

Fixes the following sparse warning:
drivers/staging/android/alarm-dev.c:259:35: warning: Using plain integer as NULL pointer

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: Android: Fix some checkpatch warnings
Sachin Kamat [Tue, 5 Jun 2012 11:10:10 +0000 (16:40 +0530)]
staging: Android: Fix some checkpatch warnings

Warnings reported by checkpatch.pl have been fixed.

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: export alloc_subdevices as comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 00:45:15 +0000 (17:45 -0700)]
staging: comedi: export alloc_subdevices as comedi_alloc_subdevices

Move the inline alloc_subdevices() function from comedidev.h
to drivers.c and rename it to comedi_alloc_subdevices(). The
function is large enough to warrant being an exported symbol
rather than being an inline in every driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging "sep" Fix typos found while reading.
Justin P. Mattock [Mon, 11 Jun 2012 14:48:46 +0000 (07:48 -0700)]
staging "sep" Fix typos found while reading.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:ad7298: Fix linker error due to missing IIO kfifo buffer
Lars-Peter Clausen [Mon, 11 Jun 2012 13:09:21 +0000 (15:09 +0200)]
staging:iio:ad7298: Fix linker error due to missing IIO kfifo buffer

The ad7298 drivers buffer implementation uses the IIO kfifo buffer, so it needs
to select IIO_KFIFO_BUF. Otherwise (if no other driver selects the symbol) the
following linker error will occur:

drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
(.text+0x245cf2): undefined reference to `iio_kfifo_allocate'
drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
(.text+0x245d7d): undefined reference to `iio_kfifo_free'
drivers/built-in.o: In function `ad7298_ring_cleanup':
(.text+0x245dcd): undefined reference to `iio_kfifo_free'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoRevert "staging: usbip: bugfix for stack corruption on 64-bit architectures"
Greg Kroah-Hartman [Tue, 12 Jun 2012 18:10:50 +0000 (11:10 -0700)]
Revert "staging: usbip: bugfix for stack corruption on 64-bit architectures"

This reverts commit 08224262adefb5e6460888b2490a96e1bc28aef5 as it's
just not right.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable <stable@vger.kernel.org>
Cc: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: ipack: delete sysfs from to-do list.
Samuel Iglesias Gonsalvez [Tue, 12 Jun 2012 09:37:46 +0000 (11:37 +0200)]
Staging: ipack: delete sysfs from to-do list.

As we have already got rid of sysfs files in the tpci200 driver, it is needed
to delete that mention in the TODO file.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: keucr: init: fixed a brace coding style issue
William Blair [Sun, 10 Jun 2012 19:10:33 +0000 (15:10 -0400)]
Staging: keucr: init: fixed a brace coding style issue

Fixed a coding style issue.

Signed-off-by: William Blair <wdblair@bu.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: usb: gadget: Configurable Composite Gadget depends on BLOCK
Andrzej Pietrasiewicz [Mon, 11 Jun 2012 09:11:59 +0000 (11:11 +0200)]
staging: usb: gadget: Configurable Composite Gadget depends on BLOCK

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: ipack: remove pr_fmt definition.
Samuel Iglesias Gonsalvez [Mon, 11 Jun 2012 06:56:36 +0000 (08:56 +0200)]
Staging: ipack: remove pr_fmt definition.

As there is no pr_* function used here, pr_fmt is not needed.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: sm7xxfb: sm7xx becomes sm7xxfb
Javier M. Mellid [Sun, 10 Jun 2012 11:12:24 +0000 (13:12 +0200)]
staging: sm7xxfb: sm7xx becomes sm7xxfb

Rename sm7xx driver to sm7xxfb. Fix Kconfig and Makefile to fit the new
change.

Changes are coherent with the rest of stable framebuffer drivers. TODO
updated.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: sm7xx: update comments and clarify supported chips
Javier M. Mellid [Sun, 10 Jun 2012 11:12:23 +0000 (13:12 +0200)]
staging: sm7xx: update comments and clarify supported chips

This patch updates/adds comments in order to clarify devices and Lynx
families supported for this driver.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: sm7xx: code improvement
Javier M. Mellid [Sun, 10 Jun 2012 11:12:22 +0000 (13:12 +0200)]
staging: sm7xx: code improvement

This patch simplifies code. It erases redundant code under little endian
compilations.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: rtl8187se, rtl8192e: fix '&' vs '|' bugs
Dan Carpenter [Sat, 9 Jun 2012 17:05:16 +0000 (20:05 +0300)]
Staging: rtl8187se, rtl8192e: fix '&' vs '|' bugs

The original code is equivalent to:

wrqu->retry.flags = 0x1000 & 0x0002;

so it just sets .flags to zero.  We should be ORing the values together
like r8192_wx_get_retry() does in drivers/staging/rtl8192u/r8192U_wx.c.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: rts5139: Fix typo in rts5139
Masanari Iida [Fri, 8 Jun 2012 15:19:17 +0000 (00:19 +0900)]
staging: rts5139: Fix typo in rts5139

Correct spelling typo in rts5139/rts51x_chip.h, rts51x_scsi.h

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>