]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agostaging: comedi: pcmmio: quiet NULL pointer sparse noise
H Hartley Sweeten [Tue, 19 Jun 2012 00:03:17 +0000 (17:03 -0700)]
staging: comedi: pcmmio: quiet NULL pointer sparse noise

The comedi_async 'inttrig' member is a pointer to a callback
function. NULL should be used to clear it not 0.

This quiets a number of sparse warnings about:

Warning: Using plain integer as NULL pointer

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio staging: another typo in iio_simple_dummy_buffer
Peter Meerwald [Mon, 18 Jun 2012 18:33:04 +0000 (20:33 +0200)]
iio staging: another typo in iio_simple_dummy_buffer

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: remove extra ; after function definition
Peter Meerwald [Mon, 18 Jun 2012 18:33:03 +0000 (20:33 +0200)]
iio: remove extra ; after function definition

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: correct documentation for IIO_CONST_ATTR_SAMP_FREQ_AVAIL, match name of #define
Peter Meerwald [Mon, 18 Jun 2012 18:33:02 +0000 (20:33 +0200)]
iio: correct documentation for IIO_CONST_ATTR_SAMP_FREQ_AVAIL, match name of #define

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: typo in iio_chan_spec.ext_info comment
Peter Meerwald [Mon, 18 Jun 2012 18:33:01 +0000 (20:33 +0200)]
iio: typo in iio_chan_spec.ext_info 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 staging: fix spelling of suppression in isl29018
Peter Meerwald [Mon, 18 Jun 2012 18:33:07 +0000 (20:33 +0200)]
iio staging: fix spelling of suppression in isl29018

beware, does change the ABI as proximity_on_chip_ambient_infrared_supression
is changed to proximity_on_chip_ambient_infrared_suppression

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio staging: fix tsl2x7x file mode
Peter Meerwald [Mon, 18 Jun 2012 18:33:05 +0000 (20:33 +0200)]
iio staging: fix tsl2x7x file mode

just drop execute permission

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 staging: fix typos in tsl*: register
Peter Meerwald [Mon, 18 Jun 2012 18:33:06 +0000 (20:33 +0200)]
iio staging: fix typos in tsl*: register

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 agostaging:iio:adc:ad799x: Use new triggered buffer setup helper function
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:56 +0000 (18:33 +0200)]
staging:iio:adc:ad799x: Use new triggered buffer setup helper function

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adc:ad7887: Use new triggered buffer setup helper function
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:55 +0000 (18:33 +0200)]
staging:iio:adc:ad7887: Use new triggered buffer setup helper function

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adc:ad7793: Use new triggered buffer setup helper function
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:54 +0000 (18:33 +0200)]
staging:iio:adc:ad7793: Use new triggered buffer setup helper function

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adc:ad7606: Use new triggered buffer setup helper function
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:53 +0000 (18:33 +0200)]
staging:iio:adc:ad7606: Use new triggered buffer setup helper function

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adc:ad7476: Use new triggered buffer setup helper function
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:52 +0000 (18:33 +0200)]
staging:iio:adc:ad7476: Use new triggered buffer setup helper function

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adc:ad7298: Use new triggered buffer setup helper function
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:51 +0000 (18:33 +0200)]
staging:iio:adc:ad7298: Use new triggered buffer setup helper function

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

The previous code was not passing the temperature channel to iio_buffer_register
since the temperature channel can not be used in buffered mode. With the new
helper functions it is not possible to do this, instead the scan index for the
temperature channel is set to -1 which will cause iio_buffer_register to ignore
the channel. (Also While we are at it also assign the symbolic constant instead
of the raw value to the channel address for the temperature channel).

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adc:ad7192: Use new triggered buffer setup helper function
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:50 +0000 (18:33 +0200)]
staging:iio:adc:ad7192: Use new triggered buffer setup helper function

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio:adc:at91: Use new triggered buffer setup helper
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:49 +0000 (18:33 +0200)]
iio:adc:at91: Use new triggered buffer setup helper

Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: Add helper function for initializing triggered buffers
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:48 +0000 (18:33 +0200)]
iio: Add helper function for initializing triggered buffers

Add a helper function for executing the common tasks which are usually involved
in setting up a simple software ringbuffer. It will allocate the buffer,
allocate the pollfunc and register the buffer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: iio_buffer_register: Skip channels with negative scan index
Lars-Peter Clausen [Mon, 18 Jun 2012 16:33:47 +0000 (18:33 +0200)]
iio: iio_buffer_register: Skip channels with negative scan index

It is not always the case that all channels can be used in buffered mode. This
patch allows channels, which can not be used in buffered mode, to set their scan
index to a negative number, which will cause iio_buffer_register to ignore the
channel.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: slicoss: Fix a typo.
Justin P. Mattock [Mon, 18 Jun 2012 14:42:24 +0000 (07:42 -0700)]
staging: slicoss: Fix a typo.

The below patch fixes a typo found while reading through staging/slicoss

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: serqt_usb2: Fix some typos.
Justin P. Mattock [Mon, 18 Jun 2012 14:42:23 +0000 (07:42 -0700)]
staging: serqt_usb2: Fix some typos.

Fixes some typos that was found while reading through staging/serqt_usb2

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: Replace pr_* with dev_* when possible.
Miguel Gómez [Mon, 18 Jun 2012 11:12:06 +0000 (13:12 +0200)]
Staging: xgifb: Replace pr_* with dev_* when possible.

Replace pr_* calls with dev_* ones when the device structure is available.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: Fix sparse warnings.
Miguel Gómez [Mon, 18 Jun 2012 11:12:05 +0000 (13:12 +0200)]
Staging: xgifb: Fix sparse warnings.

Add include files with function definitions to avoid sparse warnings.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: Remove printk usage.
Miguel Gómez [Mon, 18 Jun 2012 11:12:04 +0000 (13:12 +0200)]
Staging: xgifb: Remove printk usage.

Replace meaninful printks with pr_debug and remove useless ones.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: Remove XGIFAIL() macro and its calls.
Miguel Gómez [Mon, 18 Jun 2012 11:12:03 +0000 (13:12 +0200)]
Staging: xgifb: Remove XGIFAIL() macro and its calls.

XGIFAIL() prints a message and returns a value, but it's used only in one
place. Better remove it and replace the call with the macro content.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: define real dumpVGAReg() content only in DEBUG mode.
Miguel Gómez [Mon, 18 Jun 2012 11:12:02 +0000 (13:12 +0200)]
Staging: xgifb: define real dumpVGAReg() content only in DEBUG mode.

Define real content of dumpVGAReg() only in debug mode. Remove old condition.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: remove DPRINTK() macro and replace it with pr_debug.
Miguel Gómez [Mon, 18 Jun 2012 11:12:01 +0000 (13:12 +0200)]
Staging: xgifb: remove DPRINTK() macro and replace it with pr_debug.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: remove DEBUGPRN() macro and its uses.
Miguel Gómez [Mon, 18 Jun 2012 11:12:00 +0000 (13:12 +0200)]
Staging: xgifb: remove DEBUGPRN() macro and its uses.

Remove DEBUGPRN() macro which is defined as empty.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: reformat module parameter descriptions.
Miguel Gómez [Mon, 18 Jun 2012 11:11:59 +0000 (13:11 +0200)]
Staging: xgifb: reformat module parameter descriptions.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedi_subdevice 'io_bits' should be an unsigned int
H Hartley Sweeten [Mon, 18 Jun 2012 21:45:42 +0000 (14:45 -0700)]
staging: comedi: comedi_subdevice 'io_bits' should be an unsigned int

The 'io_bits' variable in the comedi_subdevice struct is a bitmask of
the input/output configuration of the the subdevice. It should be an
unsigned int to correctly represent this.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess: <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: fix return value for insn_bits functions
H Hartley Sweeten [Mon, 18 Jun 2012 20:16:35 +0000 (13:16 -0700)]
staging: comedi: fix return value for insn_bits functions

The comedi_subdevice 'insn_bits' functions return the number of data
elements used to perform the command. Most of the insn_bits functions
return an open coded '2' to indicate this. The same value is available
as 'insn->n'. Return that instead to better indicate what the return
means.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: remove unneeded sanity check in insn_bits functions
H Hartley Sweeten [Mon, 18 Jun 2012 18:18:25 +0000 (11:18 -0700)]
staging: comedi: remove unneeded sanity check in insn_bits functions

The comedi core does the sanity check to make sure that the data length
the INSN_BITS instruction is 2. There is no need for the drivers to do
this check. Remove all the sanity checks in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: usbduxsigma: use attach_usb() hook
Ian Abbott [Mon, 18 Jun 2012 15:35:54 +0000 (16:35 +0100)]
staging: comedi: usbduxsigma: use attach_usb() hook

Change the usbduxsigma driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.

Move the release of the driver's static 'start_stop_sem' semaphore in
usbduxsigma_attach() to occur a bit later for convenience, otherwise the
new usbduxsigma_attach_common() would need to be split in two.  I don't
think the slight delay in releasing the semaphore matters too much; it's
only used in the USB probe and disconnect functions and when attaching
and detaching comedi devices.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: vmk80xx: use attach_usb() hook
Ian Abbott [Mon, 18 Jun 2012 16:36:58 +0000 (17:36 +0100)]
staging: comedi: vmk80xx: use attach_usb() hook

Change the vmv80xx driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: usbduxfast: use attach_usb() hook
Ian Abbott [Mon, 18 Jun 2012 14:16:44 +0000 (15:16 +0100)]
staging: comedi: usbduxfast: use attach_usb() hook

Change the usbduxfast driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: change device used in dev_...() calls
Ian Abbott [Mon, 18 Jun 2012 13:05:34 +0000 (14:05 +0100)]
staging: comedi: change device used in dev_...() calls

A previous set of patches by Ravishankar Karkala Mallikarjunayya
replaced a load of printk() calls with dev_info(), dev_err(), etc.
Unfortunately, these used the 'struct device *hw_dev' member of 'struct
comedi_device') as the first parameter of these dev_...() calls, but
that pointer is usually NULL, so the kernel log messages come out a bit
wrong (they contain the phrase "(NULL device *)").

Use the 'struct device *class_dev' member of 'struct comedi_device'
instead for these dev_...() calls.  It will be non-NULL and somewhat
meaningful to users.  It's also consistent with those comedi drivers
that already use the class_dev member in their dev_...() calls.

Some of the messages included the format "comedi%d" with the minor
device number used for the "%d".  This is now redundant as it will be
the same as the dev_name() part of the kernel log message produced by
the dev_...() calls.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: speakup: fix an improperly-declared variable.
Christopher Brannon [Sat, 16 Jun 2012 21:55:20 +0000 (16:55 -0500)]
Staging: speakup: fix an improperly-declared variable.

A local static variable was declared as a pointer to a string
constant.  We're assigning to the underlying memory, so it
needs to be an array instead.

Signed-off-by: Christopher Brannon <chris@the-brannons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: fix Kconfig for COMEDI_PCMCIA_DRIVERS
H Hartley Sweeten [Fri, 15 Jun 2012 16:18:55 +0000 (09:18 -0700)]
staging: comedi: fix Kconfig for COMEDI_PCMCIA_DRIVERS

The depends on PCCARD is redundant. All of the comedi PCMCIA
drivers depend on PCMCIA which can only be enabled if PCCARD
is enabled. Remove the extra depends check.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Tested-by: Ian Abbott <abbotti@mev.co.uk>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: buffer: Fix NULL pointer deref caused by empty scan mask
Lars-Peter Clausen [Fri, 15 Jun 2012 16:08:59 +0000 (18:08 +0200)]
iio: buffer: Fix NULL pointer deref caused by empty scan mask

iio_scan_mask_match() returns NULL if the passed in scan mask is empty. This
will happen if no channel has been selected and buffer is enabled.
iio_sw_buffer_preenable() will assign NULL to indio_dev->active_scan_mask in
this case. As a result iio_update_demux() will cause a NULL pointer deref,
because it expects active_scan_mask to be non-NULL.

Since it does not make much sense to start data capture if there is no data to
capture this patch updates the code to fail gracefully in iio_scan_mask_match()
instead of crashing the kernel.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: iio/events.h typos
Peter Meerwald [Fri, 15 Jun 2012 17:25:28 +0000 (19:25 +0200)]
iio: iio/events.h typos

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 agostaging: iio:: fix some typos
Peter Meerwald [Fri, 15 Jun 2012 17:25:27 +0000 (19:25 +0200)]
staging: iio:: fix some typos

typos in comments, fix ring_sw module description

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 agostaging: iio: add IIO_ALTVOLTAGE to iio_event_monitor example
Peter Meerwald [Fri, 15 Jun 2012 17:25:26 +0000 (19:25 +0200)]
staging: iio: add IIO_ALTVOLTAGE to iio_event_monitor example

IIO_ALTVOLTAGE is used by frequency/adf4350 and frequency/ad9523

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: iio/machine.h typo
Peter Meerwald [Fri, 15 Jun 2012 17:25:25 +0000 (19:25 +0200)]
iio: iio/machine.h typo

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: cleanup sysfs-bus-iio-light-lm3533-als
Peter Meerwald [Fri, 15 Jun 2012 17:25:24 +0000 (19:25 +0200)]
iio: cleanup sysfs-bus-iio-light-lm3533-als

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: sysfs-bus-iio typo
Peter Meerwald [Fri, 15 Jun 2012 17:25:23 +0000 (19:25 +0200)]
iio: sysfs-bus-iio typo

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 agostaging: iio: Remove superfluous flush_scheduled_work
Lars-Peter Clausen [Fri, 15 Jun 2012 16:14:36 +0000 (18:14 +0200)]
staging: iio: Remove superfluous flush_scheduled_work

None of these drivers ever schedule any work, so there is no need to flush any
scheduled work when the driver is removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: iio: fix typos in simple dummy driver
Peter Meerwald [Fri, 15 Jun 2012 17:27:10 +0000 (19:27 +0200)]
staging: iio: fix typos in simple dummy driver

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 agostaging:iio:adis16400: Fix ADIS163xx AUX_ADC address
Lars-Peter Clausen [Fri, 15 Jun 2012 16:11:52 +0000 (18:11 +0200)]
staging:iio:adis16400: Fix ADIS163xx AUX_ADC address

The ADIS163xx variants use a different register address for the auxiliary ADC
channel than the ADIS16400. This patch fixes them to use the correct address.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adis16400: Fix ADIS16334 temperature address
Lars-Peter Clausen [Fri, 15 Jun 2012 16:11:51 +0000 (18:11 +0200)]
staging:iio:adis16400: Fix ADIS16334 temperature address

The channel spec for ADUS16334's temperature channel uses the address and scan
index for the Z-axis acceleration channel. This patch fixes it to use the
temperature channel address and scan index instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adis16400: Fix ADIS16300 temperature address
Lars-Peter Clausen [Fri, 15 Jun 2012 16:11:50 +0000 (18:11 +0200)]
staging:iio:adis16400: Fix ADIS16300 temperature address

The ADIS16300 uses the same address for the temperature register as the
ADIS16350 and not the same as the ADIS16400.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:adis16400: Fix ADIS16300 ROLL_OUT register address
Lars-Peter Clausen [Fri, 15 Jun 2012 16:11:49 +0000 (18:11 +0200)]
staging:iio:adis16400: Fix ADIS16300 ROLL_OUT register address

In the current driver ROLL_OUT register address is the same as the PITCH_OUT
register address. This patch fixes it to use the correct address.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: dac: Convert ad5380 to devm_regmap_* APIs
Axel Lin [Fri, 15 Jun 2012 08:40:21 +0000 (16:40 +0800)]
iio: dac: Convert ad5380 to devm_regmap_* APIs

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:gyro:adis16080: remove sparse warnings
Leed Aguilar [Thu, 14 Jun 2012 15:05:31 +0000 (11:05 -0400)]
staging:iio:gyro:adis16080: remove sparse warnings

Removed the following sparse warning:

In function 'adis16080_read_raw':
warning: 'ut' may be used uninitialized in this function

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me4000: remove PDEBUG macro
H Hartley Sweeten [Thu, 14 Jun 2012 02:13:42 +0000 (19:13 -0700)]
staging: comedi: me4000: remove PDEBUG macro

The PDEBUG macro is used to output a bunch of debug messages in the
driver. These messages might be useful when first creating the driver
but they shouldn't be in mainline. Remove it.

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

The ISR_PDEBUG macro is used to output trace messages in the isr
routine. 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 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>