platform/kernel/linux-rpi.git
7 years agostaging: most: core: separate property showing links
Andrey Shvetsov [Fri, 7 Apr 2017 13:38:35 +0000 (15:38 +0200)]
staging: most: core: separate property showing links

Currently an AIM has the following properties available to manage links:
  - write-only "remove_link" used to remove a link from a list
  - read/write "add_link" used to add a link to a list and display them

This patch transfers the read functionality of "add_link" to the new
read-only property "links" to build consistent set of properties to control
the list of links.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: core: consolidate channel attributes
Andrey Shvetsov [Fri, 7 Apr 2017 13:38:34 +0000 (15:38 +0200)]
staging: most: core: consolidate channel attributes

This patch replaces 13 temporary variables representing the attributes
to control the channel with an array of 13 elements to keep the
corresponding code compact.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: core: make use of __ATTR_* macros
Christian Gromm [Fri, 7 Apr 2017 13:38:33 +0000 (15:38 +0200)]
staging: most: core: make use of __ATTR_* macros

This patch replaces the proprietary macros with those provided by the
kernel.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: core: fix function names
Christian Gromm [Fri, 7 Apr 2017 13:38:32 +0000 (15:38 +0200)]
staging: most: core: fix function names

This patch fixes the names of the show/store functions to match the naming
convention.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: fix comment of the function remove_link_store
Andrey Shvetsov [Fri, 7 Apr 2017 13:38:31 +0000 (15:38 +0200)]
staging: most: fix comment of the function remove_link_store

This patch replaces the name store_remove_link by the remove_link_store
in the comment for the corresponding function.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: fix comment of the function add_link_store
Andrey Shvetsov [Fri, 7 Apr 2017 13:38:30 +0000 (15:38 +0200)]
staging: most: fix comment of the function add_link_store

This patch replaces the name store_add_link by the add_link_store in the
comment for the corresponding function.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove old platform support
Laura Abbott [Mon, 3 Apr 2017 18:57:54 +0000 (11:57 -0700)]
staging: android: ion: Remove old platform support

Device specific platform support has been haphazard for Ion. There have
been several independent attempts and there are still objections to
what bindings exist right now. Just remove everything for a fresh start.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove duplicate ION_IOC_MAP
Laura Abbott [Mon, 3 Apr 2017 18:57:53 +0000 (11:57 -0700)]
staging: android: ion: Remove duplicate ION_IOC_MAP

ION_IOC_MAP is the same as ION_IOC_SHARE. We really don't need two
identical interfaces. Remove it.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove import interface
Laura Abbott [Mon, 3 Apr 2017 18:57:52 +0000 (11:57 -0700)]
staging: android: ion: Remove import interface

With the expansion of dma-buf and the move for Ion to be come just an
allocator, the import mechanism is mostly useless. There isn't a kernel
component to Ion anymore and handles are private to Ion. Remove this
interface.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove custom ioctl interface
Laura Abbott [Mon, 3 Apr 2017 18:57:51 +0000 (11:57 -0700)]
staging: android: ion: Remove custom ioctl interface

Ion is now moving towards a unified interfact. This makes the custom
ioctl interface unneeded. Remove it.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove crufty cache support
Laura Abbott [Mon, 3 Apr 2017 18:57:50 +0000 (11:57 -0700)]
staging: android: ion: Remove crufty cache support

Now that we call dma_map in the dma_buf API callbacks there is no need
to use the existing cache APIs. Remove the sync ioctl and the existing
bad dma_sync calls. Explicit caching can be handled with the dma_buf
sync API.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove page faulting support
Laura Abbott [Mon, 3 Apr 2017 18:57:49 +0000 (11:57 -0700)]
staging: android: ion: Remove page faulting support

The new method of syncing with dma_map means that the page faulting sync
implementation is no longer applicable. Remove it.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Call dma_map_sg for syncing and mapping
Laura Abbott [Mon, 3 Apr 2017 18:57:48 +0000 (11:57 -0700)]
staging: android: ion: Call dma_map_sg for syncing and mapping

Technically, calling dma_buf_map_attachment should return a buffer
properly dma_mapped. Add calls to dma_map_sg to begin_cpu_access to
ensure this happens. As a side effect, this lets Ion buffers take
advantage of the dma_buf sync ioctls.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Duplicate sg_table
Laura Abbott [Mon, 3 Apr 2017 18:57:47 +0000 (11:57 -0700)]
staging: android: ion: Duplicate sg_table

Ion currently returns a single sg_table on each dma_map call. This is
incorrect for later usage.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove alignment from allocation field
Laura Abbott [Mon, 3 Apr 2017 18:57:46 +0000 (11:57 -0700)]
staging: android: ion: Remove alignment from allocation field

The align field was supposed to be used to specify the alignment of
the allocation. Nobody actually does anything with it except to check
if the alignment specified is out of bounds. Since this has no effect
on the actual allocation, just remove it.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove dmap_cnt
Laura Abbott [Mon, 3 Apr 2017 18:57:45 +0000 (11:57 -0700)]
staging: android: ion: Remove dmap_cnt

The reference counting of dma_map calls was removed. Remove the
associated counter field as well.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMerge tag 'iio-for-4.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Mon, 3 Apr 2017 13:29:12 +0000 (15:29 +0200)]
Merge tag 'iio-for-4.12c' of git://git./linux/kernel/git/jic23/iio into staging-next

Third set of new device support, cleanups and features for IIO in the 4.12 cycle

Somewhat dominated in patch numbers of last of the outreachy application
window related patches (they are still coming, despite window being closed
which is good to see!)

Good set of new drivers as well.

New device support
* ASPEED ADC
  - new driver
* cpcap PMIC ADC
  - new driver
* hid-humidity
  - driver for HID compatible humidity sensors.
* ltc2497 ADC
  - new driver
* mpu6050
  - bring bindings up to date and add trivial support for 9250
* rockchip-saradc
  - update bindings to cover rk3328
* vl6180 light, proximity and time of flight sensor.
  - new driver

Features
* meson-saradc
  - add calibration

Cleanup and minor fixes
* ad5504
  - constify attribute_group structure
  - drop casting of void *
* ad7150
  - replace some shifts of 1 by BIT macro usage
* ad7152
  - blank lines between function definitions
* ad7280a
  - octal permissions.
* ad7606
  - replace use of core mlock mutex with a local lock
* ad7746
  - replace some shifts of 1 by BIT macro usage
  - function parameter alignment
  - drop some excessive brackets (introduced in last pull request)
* ad7753
  - white space cleanup
* ad7754
  - includes in alphabetical order and groupped appropriately.
  - change from missuse of internal mlock mutex to using the buffer lock to
  also protect values during frequency update.
* ad779x
  - constify attribute_group structures
* ad9832
  - octal permissions
* adis16060
  - remove use of core mlock mutex in favour of adding a local
  _spi_write_then_read which can use the local buffer protection lock.
  - fix naming of above function.
* adis16203
  - remove locking during reads of calibbias that doesn't protect anything
  not protected elsewhere.
* adis16209
  - remove unnecessary braces in single statement if
* adis16240
  - remove unnecessary braces in single statement if
* adt7136
  - drop excess blank lines and put some in between functions.
* ams-iaq
  - replace comma with semi colon. Not actual bug, just unusual syntax.
* apds9960
  - constify attribute group structure
* as3935
  - constify attribute group structure
* bm1750
  - constify attribute group structure
* cros_ec
  - devm version of triggered buffer setup to simplify code.
* exynos
  - drop casting of void *
* hdc100x
  - constify attribute_group structure
* hid-accel
  - fix wrong scale for newly introduced gravity sensor.
* hts221
  - drop casting of void *
* hx711
  - constify attribute_group structure
* imx7d_adc
  - drop casting of void *
* lm35333
  - constify attribute_group structure
* lsm6dsx
  - drop casting of void *
  - hold ODR configuration until enabling to avoid a race condition.
* max1027
  - drop casting of void *
* max11100
  - fix a comma where semicolon was intended (no actual bug, just odd)
* max1363
  - constify attribute_group structure
* ms sensors
  - drop casting of void *
* rockchip_saradc
  - drop casting of void *
* sun4i-gpadc
  - fix missing dependency on THERMAL or presence of stubs (issue only
  introduced in pervious set)
  - drop casting of void *
* tsl2x7x
  - fix wrong standard deviation calc.  Note these aren't actually used for
  anything at the moment so bug didn't really matter.
  - constify attribute group structure.
* vf610adc
  - drop casting of void *
* vz89x
  - replace comma with semicolon. Not actual bug, just odd syntax.
* zpa2326
  - drop casting of void *

7 years agoiio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handler
Lorenzo Bianconi [Sun, 2 Apr 2017 12:58:45 +0000 (14:58 +0200)]
iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handler

This patch allows to avoid a transitory that occurs when a given sensor
has been already enabled (e.g. gyroscope) and the user is configuring
the sample frequency of the other one (e.g. accelerometer).
The transitory lasts until the accelerometer is enabled.
During that time slice the gyroscope ODR is incorrectly modified as well.
At the end of the transitory both sensors work at the right frequency.
Fix it introducing st_lsm6dsx_check_odr() routine to check ODR consistency
in write_raw handler in order to apply frequency configuration just
in st_lsm6dsx_set_odr()

Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: sun4i: add THERMAL dependency
Arnd Bergmann [Tue, 28 Mar 2017 10:07:23 +0000 (12:07 +0200)]
iio: adc: sun4i: add THERMAL dependency

With CONFIG_THERMAL=m and CONFIG_SUN4I_GPADC=y, we get a link error
from calling devm_thermal_zone_of_sensor_register:

drivers/iio/built-in.o: In function `sun4i_gpadc_probe':
:(.text+0x1c284): undefined reference to `devm_thermal_zone_of_sensor_register'

This adds a Kconfig dependency to ensure we can only have the ADC
driver as built-in when this function is also built-in, or when
we see the empty stub implementation. When the thermal code is
a module, we can still build the adc driver as a module, too.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: d1caa99055382 ("iio: adc: add support for Allwinner SoCs ADC")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:adc: Driver for Linear Technology LTC2497 ADC
Michael Hennerich [Wed, 29 Mar 2017 09:42:58 +0000 (11:42 +0200)]
iio:adc: Driver for Linear Technology LTC2497 ADC

This patch adds support for the Analog Devices / Linear Technology
LTC2497 ADCs. The LTC2497 is a 16-channel (eight differential),
16-bit, high precision, delta-sigma ADC with an automatic, differential,
input current cancellation front end and a 2-wire, I2C interface.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: ad9832: use 4-digit octal permissions
Guru Das Srinagesh [Thu, 30 Mar 2017 09:55:39 +0000 (02:55 -0700)]
staging: iio: ad9832: use 4-digit octal permissions

This fixes the coding style issue of using S_IWUSR in place of 4-digit
octal numbers.

Issue detected by checkpatch.

Signed-off-by: Guru Das Srinagesh <gurooodas@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:imu:mpu6050 add explicit mpu9250 support
Jonathan Cameron [Sun, 26 Mar 2017 11:11:00 +0000 (12:11 +0100)]
iio:imu:mpu6050 add explicit mpu9250 support

The mpu9250 is a SIP containing an mpu6500 and an ak8975.  If this was all
there was too it there would be no need for explicit handling in the driver.
Arguably the bindings would also only reflect the presence of an mpu6500 with
the ak8975 hanging off it, as the kernel doesn't care that they are in one
package.

However, the WHOAMI value changes as well so best to add explicit support.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:imu:mpu6050 update i2c bindings to reflect i2c-gate and supported parts
Jonathan Cameron [Sun, 26 Mar 2017 11:10:59 +0000 (12:10 +0100)]
iio:imu:mpu6050 update i2c bindings to reflect i2c-gate and supported parts

These bindings are somewhat lagging the state of the driver.  The i2c-gate
bindings are documented elsewhere, but it seems sensible to at least have
an example and cross reference in here.  SPI bindings will need to be the
subject of a future patch.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
7 years agodt-bindings: iio: rockchip-saradc: add support for rk3328
Liang Chen [Mon, 27 Mar 2017 09:40:46 +0000 (17:40 +0800)]
dt-bindings: iio: rockchip-saradc: add support for rk3328

The rk3328 saradc is the same as rk3399.

Signed-off-by: Liang Chen <cl@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: pressure: zpa2326: Remove unnecessary cast on void pointer
simran singhal [Sat, 1 Apr 2017 14:18:39 +0000 (19:48 +0530)]
iio: pressure: zpa2326: Remove unnecessary cast on void pointer

The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer
simran singhal [Sat, 1 Apr 2017 14:16:24 +0000 (19:46 +0530)]
iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer

The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: humidity: hts221: Remove unnecessary cast on void pointer
simran singhal [Sat, 1 Apr 2017 14:14:15 +0000 (19:44 +0530)]
iio: humidity: hts221: Remove unnecessary cast on void pointer

The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: dac: ad5504: Remove unnecessary cast on void pointer
simran singhal [Sat, 1 Apr 2017 14:11:53 +0000 (19:41 +0530)]
iio: dac: ad5504: Remove unnecessary cast on void pointer

The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: common: ms_sensors: Remove unnecessary cast on void pointer
simran singhal [Sat, 1 Apr 2017 14:09:21 +0000 (19:39 +0530)]
iio: common: ms_sensors: Remove unnecessary cast on void pointer

The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: Remove unnecessary cast on void pointer
simran singhal [Sat, 1 Apr 2017 14:06:14 +0000 (19:36 +0530)]
iio: adc: Remove unnecessary cast on void pointer

The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: gyro: adis16060: Change the name of function.
simran singhal [Fri, 31 Mar 2017 10:21:43 +0000 (15:51 +0530)]
iio: gyro: adis16060: Change the name of function.

Change the name of function from adis16060_spi_write_than_read()
to adis16060_spi_write_then_read(). change "than" to "then" as
its time depended.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: lm3533-als: constify attribute_group structures
simran singhal [Thu, 30 Mar 2017 18:40:38 +0000 (00:10 +0530)]
iio: light: lm3533-als: constify attribute_group structures

Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant. Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.event_attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

As the attrs field of iio_info structures is also constant, so these
attribute_group structures can also be declared constant. Done manually.

File size before:
   text    data     bss     dec     hex filename
   5798    2376       0    8174    1fee drivers/iio/light/lm3533-als.o

File size after:
   text    data     bss     dec     hex filename
   5926    2248       0    8174    1fee drivers/iio/light/lm3533-als.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: Aspeed ADC
Rick Altherr [Tue, 28 Mar 2017 21:52:59 +0000 (14:52 -0700)]
iio: Aspeed ADC

Aspeed BMC SoCs include a 16 channel, 10-bit ADC. Low and high threshold
interrupts are supported by the hardware but are not currently implemented.

Signed-off-by: Rick Altherr <raltherr@google.com>
Tested-by: Xo Wang <xow@google.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: dt-bindings: Document bindings for Aspeed ADC
Rick Altherr [Tue, 28 Mar 2017 21:52:58 +0000 (14:52 -0700)]
Documentation: dt-bindings: Document bindings for Aspeed ADC

Signed-off-by: Rick Altherr <raltherr@google.com>
Acked-by: Joel Stanley <joel@jms.id.au>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: light: tsl2x7x constify attribute_group structures
simran singhal [Sat, 1 Apr 2017 02:28:56 +0000 (07:58 +0530)]
staging: iio: light: tsl2x7x constify attribute_group structures

As the event_attrs field of iio_info structures is constant, so these
attribute_group structures can also be declared constant.

File size before:
   text    data     bss     dec     hex filename
  15064    1528       0   16592    40d0
drivers/staging/iio/light/tsl2x7x_core.o

File size after:
   text    data     bss     dec     hex filename
  15192    1400       0   16592    40d0
drivers/staging/iio/light/tsl2x7x_core.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: hx711: constify attribute_group structures
simran singhal [Sat, 1 Apr 2017 08:17:51 +0000 (13:47 +0530)]
iio: adc: hx711: constify attribute_group structures

Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
   3042     480       0    3522     dc2 drivers/iio/adc/hx711.o

File size after:
   text    data     bss     dec     hex filename
   3098     416       0    3514     dba drivers/iio/adc/hx711.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: humidity: hdc100x: constify attribute_group structures
simran singhal [Sat, 1 Apr 2017 08:23:33 +0000 (13:53 +0530)]
iio: humidity: hdc100x: constify attribute_group structures

Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
   3459     488       0    3947     f6b drivers/iio/humidity/hdc100x.o

File size after:
   text    data     bss     dec     hex filename
   3507     424       0    3931     f5b drivers/iio/humidity/hdc100x.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: apds9960: constify attribute_group structures
simran singhal [Sat, 1 Apr 2017 08:29:10 +0000 (13:59 +0530)]
iio: light: apds9960: constify attribute_group structures

Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
   8503     488       0    8991    231f drivers/iio/light/apds9960.o

File size after:
   text    data     bss     dec     hex filename
   8567     424       0    8991    231f drivers/iio/light/apds9960.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: bh1750: constify attribute_group structures
simran singhal [Sat, 1 Apr 2017 08:33:30 +0000 (14:03 +0530)]
iio: light: bh1750: constify attribute_group structures

Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
   2276     352       0    2628     a44 drivers/iio/light/bh1750.o

File size after:
   text    data     bss     dec     hex filename
   2340     320       0    2660     a64 drivers/iio/light/bh1750.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: proximity: as3935: constify attribute_group structures
simran singhal [Sat, 1 Apr 2017 08:39:55 +0000 (14:09 +0530)]
iio: proximity: as3935: constify attribute_group structures

Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
   4037     288       0    4325    10e5 drivers/iio/proximity/as3935.o

File size after:
   text    data     bss     dec     hex filename
   4101     256       0    4357    1105 drivers/iio/proximity/as3935.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: cpcap: Add minimal support for CPCAP PMIC ADC
Tony Lindgren [Fri, 24 Mar 2017 03:38:42 +0000 (20:38 -0700)]
iio: adc: cpcap: Add minimal support for CPCAP PMIC ADC

On Motorola phones like droid 4 there is a custom CPCAP PMIC. This PMIC
has ADCs that are used for battery charging and USB PHY VBUS and ID pin
detection.

Unfortunately the only documentation for this ADC seems to be the
Motorola mapphone Linux kernel tree. I have tested that reading raw and
scaled values works, but I have not used the timed sampling that the ADC
seems to support.

Let's add a minimal support for it so we can eventually provide IIO
channels for the related battery charging and USB PHY drivers.

Cc: devicetree@vger.kernel.org
Cc: Marcel Partap <mpartap@gmx.net>
Cc: Michael Scott <michael.scott@linaro.org>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: update locking method during frequency writes
Gargi Sharma [Thu, 30 Mar 2017 09:33:46 +0000 (15:03 +0530)]
staging: iio: update locking method during frequency writes

The driver needs to insure atomicity during frequency
changes of bus and device. The iiodev->mlock as used
was not doing that. Replace it with the drivers existing
buffer lock and introduce an auxiliary spi_write() that does
not hold the lock.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodrivers: iio: chemical: replace comma with a semicolon
Arushi Singhal [Thu, 30 Mar 2017 12:41:22 +0000 (18:11 +0530)]
drivers: iio: chemical: replace comma with a semicolon

Replace a comma between expression statements by a semicolon. This
changes the semantics of the code, but given the current indentation
appears to be what is intended.
A simplified version of the Coccinelle semantic patch that performs this
transformation is as follows:

// <smpl>
@r@
expression e1,e2;
@@

 e1
-,
+;
 e2;
// </smpl>

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: replace comma with a semicolon
Arushi Singhal [Thu, 30 Mar 2017 12:46:03 +0000 (18:16 +0530)]
iio: adc: replace comma with a semicolon

Replace a comma between expression statements by a semicolon. This
changes the semantics of the code, but given the current indentation
appears to be what is intended.
A simplified version of the Coccinelle semantic patch that performs this
transformation is as follows:

// <smpl>
@r@
expression e1,e2;
@@

 e1
-,
+;
 e2;
// </smpl>

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: ad799x: constify attribute_group structures
simran singhal [Tue, 28 Mar 2017 20:07:45 +0000 (01:37 +0530)]
iio: adc: ad799x: constify attribute_group structures

Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.event_attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
  26051     464       0   26515    6793 drivers/iio/adc/ad799x.o

File size after:
   text    data     bss     dec     hex filename
  26115     400       0   26515    6793 drivers/iio/adc/ad799x.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: max1363: constify attribute_group structures
simran singhal [Tue, 28 Mar 2017 20:15:28 +0000 (01:45 +0530)]
iio: adc: max1363: constify attribute_group structures

Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant. Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.event_attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
  36951     448       0   37399    9217 drivers/iio/adc/max1363.o

File size after:
   text    data     bss     dec     hex filename
  37015     384       0   37399    9217 drivers/iio/adc/max1363.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: dac: ad5504: constify attribute_group structures
simran singhal [Tue, 28 Mar 2017 20:21:48 +0000 (01:51 +0530)]
iio: dac: ad5504: constify attribute_group structures

Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant. Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.event_attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text    data     bss     dec     hex filename
   3046     360       0    3406     d4e drivers/iio/dac/ad5504.o

File size after:
   text    data     bss     dec     hex filename
   3110     296       0    3406     d4e drivers/iio/dac/ad5504.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoStaging: lustre: lnet: code style fix
Sergiy Redko [Sat, 25 Mar 2017 06:15:25 +0000 (17:15 +1100)]
Staging: lustre: lnet: code style fix

Fixed code style error found by checkpatch by adding a space after a
comma in function parameter list.

Signed-off-by: Sergiy Redko <sergredko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192e: Fix embedded function names with __func__
Suniel Mahesh [Thu, 23 Mar 2017 11:44:58 +0000 (17:14 +0530)]
staging: rtl8192e: Fix embedded function names with __func__

Prefer and make it generic by using %s and __func__ to print
functions name instead of embedding functions name in print statements

Signed-off-by: Suniel Mahesh <suniel.spartan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: vt6655 - block comments style fix
Derek Robson [Sat, 25 Mar 2017 01:55:39 +0000 (14:55 +1300)]
Staging: vt6655 - block comments style fix

Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrivers/staging/wilc1000: Removing explicit function tracing using dev_dbg/info
Pushkar Jambhlekar [Fri, 24 Mar 2017 07:33:12 +0000 (13:03 +0530)]
drivers/staging/wilc1000: Removing explicit function tracing using dev_dbg/info

ftrace can be used to trace functions. Removing function tracing using dev_dbg/info

Signed-off-by: Pushkar Jambhlekar <pushkar.iit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrivers/staging/wilc1000: Using __func__ instead of hardcoded function name
Pushkar Jambhlekar [Fri, 24 Mar 2017 07:28:45 +0000 (12:58 +0530)]
drivers/staging/wilc1000: Using __func__ instead of hardcoded function name

dev_err: replacing hardcoded function name with '%s' and __func__

Signed-off-by: Pushkar Jambhlekar <pushkar.iit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: remove error message task
Tobin C. Harding [Mon, 27 Mar 2017 23:28:40 +0000 (10:28 +1100)]
staging: dgnc: remove error message task

TODO file lists task to remove unnecessary error messages. There are
no unnecessary error messages in the driver, this must have been done
already.

Remove task from TODO file.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: remove dead code
Tobin C. Harding [Mon, 27 Mar 2017 23:28:39 +0000 (10:28 +1100)]
staging: dgnc: remove dead code

Driver contains dead code, guarded with #ifdef's. We can safely remove
this, it will be in the git history if it is later needed.

Remove dead code.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: remove struct member magic numbers
Tobin C. Harding [Mon, 27 Mar 2017 23:28:38 +0000 (10:28 +1100)]
staging: dgnc: remove struct member magic numbers

Driver uses magic number members within structs, this is an antiquated
method of catching data errors. We don't do things that way any more.

Remove magic number struct members. Remove all checks to magic
numbers.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: remove unnecessary comments
Tobin C. Harding [Mon, 27 Mar 2017 23:28:37 +0000 (10:28 +1100)]
staging: dgnc: remove unnecessary comments

TODO file lists task to remove unnecessary comments.

Make initial attempt at removing unnecessary comments. Choose not to
be to vicious in removal. We can remove more once the driver is
cleaned up/tested some more.

For functions with internal linkage, reduce the function comment where
possible. For functions with external linkage, migrate the function
comment to kernel doc format.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: remove double underscore
Tobin C. Harding [Mon, 27 Mar 2017 23:28:36 +0000 (10:28 +1100)]
staging: dgnc: remove double underscore

Pre-processor header guards use double underscore, typically kernel
code uses single underscore when defining header guards. 'endif'
statement should include what is ending as a comment string.

Remove double underscore, add comment string to 'endif'

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: clean up header comments
Tobin C. Harding [Mon, 27 Mar 2017 23:28:35 +0000 (10:28 +1100)]
staging: dgnc: clean up header comments

TODO file has task: remove unnecessary comments. Driver uses some
custom comment format. Driver would be better if it used kernel doc
format.

Audit header file comments. Replace struct comments with kernel doc
format comments. Remove unnecessary comments.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Have unisys_vmcall return Linux error instead of VMCALL...
David Kershner [Tue, 28 Mar 2017 13:35:01 +0000 (09:35 -0400)]
staging: unisys: visorbus: Have unisys_vmcall return Linux error instead of VMCALL error

The function unisys_vmcall was returning VMCALL specific errors and the
calling code was ignoring which error was actually returned. Instead we
should be mapping the VMCALL error into a proper Linux error and then
returning that, since we now have an error we know what to do with, we
don't have to drop it but we can send it up the stack.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: move unisys_vmcall into visorchipset
David Kershner [Tue, 28 Mar 2017 13:35:00 +0000 (09:35 -0400)]
staging: unisys: visorbus: move unisys_vmcall into visorchipset

The only one using unisys_vmcall was visorchipset.c, it can be moved into
the visorchipset file directly instead of being in a header file.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Update vmcallinterface comment
David Kershner [Tue, 28 Mar 2017 13:34:59 +0000 (09:34 -0400)]
staging: unisys: visorbus: Update vmcallinterface comment

The comment at the beginning of the vmcallinterface.h file references IO
Virtualization. It should be more specific that it is referencing s-Par
Virtualization.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of ISSUE_IO_VMCALL
David Kershner [Tue, 28 Mar 2017 13:34:58 +0000 (09:34 -0400)]
staging: unisys: visorbus: get rid of ISSUE_IO_VMCALL

The macro ISSUE_IO_VMCALL was a wrapper around the function unisys_vmcall.
It doesn't need to exist and was just being noisy, so get rid of it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove useless ifdef
David Kershner [Tue, 28 Mar 2017 13:34:57 +0000 (09:34 -0400)]
staging: unisys: visorbus: remove useless ifdef

We shouldn't be checking if VMCALL_CONTROLVM_ADDR is defined, remove it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: consolidate if statements
David Kershner [Tue, 28 Mar 2017 13:34:56 +0000 (09:34 -0400)]
staging: unisys: visorbus: consolidate if statements

We had several if statements inside of if statements that should be
consolidated into an if statement with an && to clean up the code some
more.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of braces around single statements
David Kershner [Tue, 28 Mar 2017 13:34:55 +0000 (09:34 -0400)]
staging: unisys: visorbus: get rid of braces around single statements

Remove braces around single line if statements, they are not needed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to chipset_device_pause/resume
David Kershner [Tue, 28 Mar 2017 13:34:54 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to chipset_device_pause/resume

If there is an error in chipset_device_pause/resume don't try to respond,
error out and let the calling functions respond to this error just like
any other error they encounter.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to initiate_chipset_device_pause_resume
David Kershner [Tue, 28 Mar 2017 13:34:53 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to initiate_chipset_device_pause_resume

Clean up the function to remove some if statments that should be done
in the calling function.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: don't unregister if we failed to register
David Kershner [Tue, 28 Mar 2017 13:34:52 +0000 (09:34 -0400)]
staging: unisys: visorbus: don't unregister if we failed to register

If we fail to register the visordriver, don't call unregister, just
return with the error.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: don't ignore visorchannel_read error
David Kershner [Tue, 28 Mar 2017 13:34:51 +0000 (09:34 -0400)]
staging: unisys: visorbus: don't ignore visorchannel_read error

Don't override the visorchannel_read_error, just return the
error that it generates.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: check for err from dev_set_name
David Kershner [Tue, 28 Mar 2017 13:34:50 +0000 (09:34 -0400)]
staging: unisys: visorbus: check for err from dev_set_name

The function dev_set_name can return an error, don't just ignore it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: cleanup error handling in visorbus_uevent
David Kershner [Tue, 28 Mar 2017 13:34:49 +0000 (09:34 -0400)]
staging: unisys: visorbus: cleanup error handling in visorbus_uevent

The add_uevent_var returns an error. Don't overwrite the error with
-ENOMEM, just pass the error code back up.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of unused parameter forcenomatch
David Kershner [Tue, 28 Mar 2017 13:34:48 +0000 (09:34 -0400)]
staging: unisys: visorbus: get rid of unused parameter forcenomatch

The forcenomatch parameter was not being used, so get rid of it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of unused parameter forcematch
David Kershner [Tue, 28 Mar 2017 13:34:47 +0000 (09:34 -0400)]
staging: unisys: visorbus: get rid of unused parameter forcematch

The forcematch parameter was not being used, so get rid of it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of create_bus_type.
David Kershner [Tue, 28 Mar 2017 13:34:46 +0000 (09:34 -0400)]
staging: unisys: visorbus: get rid of create_bus_type.

Create bus_type was just calling register_bustype. Since we control how
many times we call create_bus_type it was extraneous keeping a counter if
the bus was already registered, so the functions were no longer needed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: fix error handling in create_bus_instance
David Kershner [Tue, 28 Mar 2017 13:34:45 +0000 (09:34 -0400)]
staging: unisys: visorbus: fix error handling in create_bus_instance

The function get_vbus_header_info returns errors that were being handled
incorrectly. Fix the error handling in create_bus_instance.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling visorbus_enable_channel_interrupt
David Kershner [Tue, 28 Mar 2017 13:34:44 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling visorbus_enable_channel_interrupt

Add error handling to visorbus_enable_channel_interrupt.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling for dev_start_periodic_work
David Kershner [Tue, 28 Mar 2017 13:34:43 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling for dev_start_periodic_work

Report errors if we have a problem in dev_start_periodic_work.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: remove client from spar_check_channel
David Kershner [Tue, 28 Mar 2017 13:34:42 +0000 (09:34 -0400)]
staging: unisys: remove client from spar_check_channel

We only have one version of spar_check_channel, get rid of the client
at the end and help save space.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of shouting SPAR_VBUS_CHANNEL_CLIENT_OK macro
David Kershner [Tue, 28 Mar 2017 13:34:41 +0000 (09:34 -0400)]
staging: unisys: visorbus: get rid of shouting SPAR_VBUS_CHANNEL_CLIENT_OK macro

The macro SPAR_VBUS_CHANNEL_CLIENT_OK was noisy and only used in one place
so get rid of it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: move vbuschannel_print_devinfo from .h to .c file
David Kershner [Tue, 28 Mar 2017 13:34:40 +0000 (09:34 -0400)]
staging: unisys: visorbus: move vbuschannel_print_devinfo from .h to .c file

Move vbuschannel_print_devinfo from vbuchannel.h to visorbus_main.c since
it is only referenced in visorbus_main.c. Since it is in a .c file, get
rid of the inline for it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: consolidate bus_responder and device_responder
David Kershner [Tue, 28 Mar 2017 13:34:39 +0000 (09:34 -0400)]
staging: unisys: visorbus: consolidate bus_responder and device_responder

With all the code churn, bus_responder and device_responder have become
identical, consolidate them to the same function.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling for chipset_device_create
David Kershner [Tue, 28 Mar 2017 13:34:38 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling for chipset_device_create

Adds error handling to the chipset_device_create message. If it returns
a failure, it is assumed it has not signaled the s-Par firmware of the
failure and the caller must do that.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visornic: add error handling for visorchannel_signalinsert/remove
David Kershner [Tue, 28 Mar 2017 13:34:37 +0000 (09:34 -0400)]
staging: unisys: visornic: add error handling for visorchannel_signalinsert/remove

Since signalinsert/remove now return valid error codes, we need to check
them when we call them in visornic. The error codes need to propagate out
to the calling functions.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add __packed to structures in controlvmchannel.h
Sameer Wadgaonkar [Tue, 28 Mar 2017 13:34:36 +0000 (09:34 -0400)]
staging: unisys: visorbus: add __packed to structures in controlvmchannel.h

Added the __packed keyword to all structures in controlvmchannel.h
to ensure alignment and size in memory.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to chipset_bus_create
David Kershner [Tue, 28 Mar 2017 13:34:35 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to chipset_bus_create

The function chipset_bus_create should return an error. If an error
is returned, it is assumed the response has not been sent by bus_create.

Correctly handle when the error has been returned in visorchipset.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remaining_steps convert ret to err
David Kershner [Tue, 28 Mar 2017 13:34:34 +0000 (09:34 -0400)]
staging: unisys: visorbus: remaining_steps convert ret to err

The ret variable was only returning an error, so changing it to err to
be more consistent across the file.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: textid_store convert ret to err
David Kershner [Tue, 28 Mar 2017 13:34:33 +0000 (09:34 -0400)]
staging: unisys: visorbus: textid_store convert ret to err

The ret variable was only returning an error, so changing it to err to
be more consistent across the file.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: error_store convert ret to err
David Kershner [Tue, 28 Mar 2017 13:34:32 +0000 (09:34 -0400)]
staging: unisys: visorbus: error_store convert ret to err

The ret variable was only returning an error, so changing it to err to
be more consistent across the file.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: boottotool convert ret to err
David Kershner [Tue, 28 Mar 2017 13:34:31 +0000 (09:34 -0400)]
staging: unisys: visorbus: boottotool convert ret to err

The ret variable was only returning an error, so changing it to err to
be more consistent across the file.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: convert ret to err to be consistent
David Kershner [Tue, 28 Mar 2017 13:34:30 +0000 (09:34 -0400)]
staging: unisys: visorbus: convert ret to err to be consistent

The ret variable was only returning an error, so changing it to err to
be more consistent across the file.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove invalid comment, we are one driver.
David Kershner [Tue, 28 Mar 2017 13:34:29 +0000 (09:34 -0400)]
staging: unisys: visorbus: remove invalid comment, we are one driver.

Removed a comment that was describing the relationship between the
visorchipset driver and the visorbus driver. Since they are now one
driver the comment no longer makes sense.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: move bus_device_info_init to visorbus_main.c
David Kershner [Tue, 28 Mar 2017 13:34:28 +0000 (09:34 -0400)]
staging: unisys: visorbus: move bus_device_info_init to visorbus_main.c

The function bus_device_info_init was defined in visorbus_private.h. The
only file that uses it is visorbus_main.c so move the function into the .c
file instead.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to remaining_steps_show
David Kershner [Tue, 28 Mar 2017 13:34:27 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to remaining_steps_show

Don't just drop the error from visorchannel_read on the floor, report it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling textid_show
David Kershner [Tue, 28 Mar 2017 13:34:26 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling textid_show

Don't just drop the error from visorchannel_read on the floor, report it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to error_show
David Kershner [Tue, 28 Mar 2017 13:34:25 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to error_show

Don't just drop the error from visorchannel_read on the floor, report it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to boottotool_show
David Kershner [Tue, 28 Mar 2017 13:34:24 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to boottotool_show

Don't just drop the error from visorchannel_read on the floor, report it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to toolaction_show
David Kershner [Tue, 28 Mar 2017 13:34:23 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to toolaction_show

Don't just drop the error from visorchannel_read on the floor, report it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling around kobject_uevent
David Kershner [Tue, 28 Mar 2017 13:34:22 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling around kobject_uevent

The function kobject_uevent_env can return an error, pass that error
to the caller so it can be handled correctly.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling for parahotplug_request_kickoff
David Kershner [Tue, 28 Mar 2017 13:34:21 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling for parahotplug_request_kickoff

The function kobject_uevent_env returns an error we shouldn't just drop it
on the floor but we should report it back to the caller. Since it now
returns an error, need to add proper error handling to
parahotplug_process_message.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add error handling to controlvm_periodic_work
David Kershner [Tue, 28 Mar 2017 13:34:20 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to controlvm_periodic_work

The function controlvm_periodic_work should handle errors appropriately.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>