platform/kernel/linux-rpi.git
6 years agoiio: light: add support for UVIS25 sensor
Lorenzo Bianconi [Thu, 23 Nov 2017 22:59:05 +0000 (23:59 +0100)]
iio: light: add support for UVIS25 sensor

add support for STMicroelectronics UVIS25 uv sensor
http://www.st.com/resource/en/datasheet/uvis25.pdf

- continuos mode support
- i2c support
- spi support
- trigger mode support
- system PM support

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoMAINTAINERS: Add missing IIO ABI entries
Lukas Wunner [Sat, 25 Nov 2017 09:27:19 +0000 (10:27 +0100)]
MAINTAINERS: Add missing IIO ABI entries

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Andreas Klinger <ak@it-klinger.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: aspeed: Deassert reset in probe
Joel Stanley [Tue, 31 Oct 2017 02:12:03 +0000 (12:42 +1030)]
iio: adc: aspeed: Deassert reset in probe

The ASPEED SoC must deassert a reset in order to use the ADC peripheral.

The device tree bindings are updated to document the resets phandle, and
the example is updated to match what is expected for both the reset and
clock phandle. Note that the bindings should have always had the reset
controller, as the hardware is unusable without it.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agodt-bindings: iio: health: Add MAX30105 support to max30102.txt
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:43 +0000 (21:45 +0200)]
dt-bindings: iio: health: Add MAX30105 support to max30102.txt

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Add MAX30105 support
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:42 +0000 (21:45 +0200)]
iio: health: max30102: Add MAX30105 support

The Maxim MAX30105 part adds a third LED (green) and uses a multi-LED
measuring mode producing three measurements

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Prepare for copying varying number of measurements
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:41 +0000 (21:45 +0200)]
iio: health: max30102: Prepare for copying varying number of measurements

Current code assumes always 2 measurements (6 bytes) have to be copied,
prepare for more flexibility

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Move mode setting to buffer_postenable
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:40 +0000 (21:45 +0200)]
iio: health: max30102: Move mode setting to buffer_postenable

Move the programming of the mode setting from init() to
buffer_postenable()

Split out a separate function to
only update the power/shutdown bit

This changes permits to more easily implement different
modes of measurements in further patches

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Introduce indices for LED channels
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:39 +0000 (21:45 +0200)]
iio: health: max30102: Introduce indices for LED channels

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Add power enable parameter to get_temp function
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:38 +0000 (21:45 +0200)]
iio: health: max30102: Add power enable parameter to get_temp function

Chip must not be in shutdown for reading temperature, so briefly leave
shutdown if buffer is not already running

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Introduce intensity channel macro
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:37 +0000 (21:45 +0200)]
iio: health: max30102: Introduce intensity channel macro

Signed-off-by: Peter Meerwald-Stalder <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Add check for part ID
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:36 +0000 (21:45 +0200)]
iio: health: max30102: Add check for part ID

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Check retval of powermode function
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:35 +0000 (21:45 +0200)]
iio: health: max30102: Check retval of powermode function

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Fix mode config values
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:34 +0000 (21:45 +0200)]
iio: health: max30102: Fix mode config values

Table 4 of the datasheet specifies the mode control, these are not
individual bits; add multi LED mode

Add multi-LED mode and fix MODE_MASK (3 bits wide, not 2)

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Remove inconsistent full stop in error message
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:33 +0000 (21:45 +0200)]
iio: health: max30102: Remove inconsistent full stop in error message

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: health: max30102: Fix missing newline in dev_err
Peter Meerwald-Stadler [Fri, 27 Oct 2017 19:45:32 +0000 (21:45 +0200)]
iio: health: max30102: Fix missing newline in dev_err

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: stm32: add support for differential channels
Fabrice Gasnier [Wed, 25 Oct 2017 09:27:45 +0000 (11:27 +0200)]
iio: adc: stm32: add support for differential channels

STM32H7 ADC channels can be configured either as single ended or
differential with 'st,adc-channels' or 'st,adc-diff-channels'
(positive and negative input pair: <vinp vinn>, ...).

Differential channels have different offset and scale, from spec:
raw value = (full_scale / 2) * (1 + (vinp - vinn) / vref).
Add offset attribute.

Differential channels are selected by DIFSEL register. Negative
inputs must be added to pre-selected channels as well (PCSEL).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: stm32: remove const channel names definition
Fabrice Gasnier [Wed, 25 Oct 2017 09:27:44 +0000 (11:27 +0200)]
iio: adc: stm32: remove const channel names definition

Remove const array that defines channels. Build channels definition
at probe time, when initializing channels (only for requested ones).
This will ease adding differential channels support.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agodt-bindings: iio: adc: stm32: add support for diff channels
Fabrice Gasnier [Wed, 25 Oct 2017 09:27:43 +0000 (11:27 +0200)]
dt-bindings: iio: adc: stm32: add support for diff channels

STM32H7 ADC channels may be configured either as single-ended or
differential.
Add 'st,adc-diff-channels' property to support differential channels.
Differential channels are defined as a pair of positive and negative
inputs: vinp & vinn.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ina2xx: Allow setting Shunt Voltage PGA gain and Bus Voltage range
Stefan Brüns [Sat, 28 Oct 2017 21:12:48 +0000 (23:12 +0200)]
iio: adc: ina2xx: Allow setting Shunt Voltage PGA gain and Bus Voltage range

Reducing shunt and bus voltage range improves the accuracy, so allow
altering the default settings.

Both settings are exposed as gain values. While for the shunt voltage
this is straightforward, the bus range settings of 32V (default) and 16V
are mapped to gain values of 1 resp. 2, to provide a uniform API to
userspace.

As the gain settings are incorporated into the raw values by the sensor
itself, adjusting of the scale attributes is not necessary.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ina2xx: Use LSB specifier instead of divider in config
Stefan Brüns [Sat, 28 Oct 2017 21:12:47 +0000 (23:12 +0200)]
iio: adc: ina2xx: Use LSB specifier instead of divider in config

While the config uses the physical value corresponding to the LSB
for both the power and the bus voltage register, the shunt voltage is
specified as parts of 1 mV. Use the LSB physical value for all registers.

No functional change.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ina2xx: Shift bus voltage register to mask flag bits
Stefan Brüns [Sat, 28 Oct 2017 21:12:46 +0000 (23:12 +0200)]
iio: adc: ina2xx: Shift bus voltage register to mask flag bits

Lower bits of the INA219/220 bus voltage register are conversion
status flags, properly shift the value.

When reading via IIO buffer, the value is passed on unaltered,
shifting is the responsibility of the user.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: imu: inv_mpu6050: Remove duplicate NULL check
Andy Shevchenko [Tue, 31 Oct 2017 14:21:47 +0000 (16:21 +0200)]
iio: imu: inv_mpu6050: Remove duplicate NULL check

Since i2c_unregister_device() became NULL-aware we may remove duplicate
NULL check.

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad7746: Improve unlocking of a mutex in ad7746_start_calib()
Markus Elfring [Fri, 3 Nov 2017 08:26:28 +0000 (09:26 +0100)]
staging: iio: ad7746: Improve unlocking of a mutex in ad7746_start_calib()

* Add a jump target so that a call of the function "mutex_unlock" is stored
  only twice in this function implementation.

* Replace two calls by goto statements.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad7152: Improve unlocking of a mutex in ad7152_start_calib()
Markus Elfring [Fri, 3 Nov 2017 08:00:25 +0000 (09:00 +0100)]
staging: iio: ad7152: Improve unlocking of a mutex in ad7152_start_calib()

* Add a jump target so that a call of the function "mutex_unlock" is stored
  only twice in this function implementation.

* Replace two calls by goto statements.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: magnetometer: ak8975: Add another ACPI ID
Andy Shevchenko [Fri, 3 Nov 2017 13:03:40 +0000 (15:03 +0200)]
iio: magnetometer: ak8975: Add another ACPI ID

Add new ACPI ID for ak9911 as had been found on prototype board.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: proximity: sx9500: Add another ACPI ID
Andy Shevchenko [Fri, 3 Nov 2017 13:03:39 +0000 (15:03 +0200)]
iio: proximity: sx9500: Add another ACPI ID

Add new ACPI ID for sx9500 as had been found on prototype board.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: accel: mma8452: Rename config structs for readability
Harinath Nampally [Sun, 5 Nov 2017 18:00:03 +0000 (13:00 -0500)]
iio: accel: mma8452: Rename config structs for readability

Rename structs holding event configuration registers
to more appropriate names. This naming is consistent
with the event config register names given in the
mma845x and fxls8471 datasheets.

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
Acked-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: accel: mma8452: Rename a struct for code readibility
Harinath Nampally [Sun, 5 Nov 2017 18:00:02 +0000 (13:00 -0500)]
iio: accel: mma8452: Rename a struct for code readibility

Rename time step look up struct to generic name
as the values in the look table are same for all
the other events like pulse, transient etc.

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
Acked-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoDocumentation: iio: Fix typo
Peter Meerwald-Stadler [Sun, 5 Nov 2017 23:25:00 +0000 (00:25 +0100)]
Documentation: iio: Fix typo

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: light: Add driver for IDT ZOPT2201 ambient light and UVB sensor
Peter Meerwald-Stadler [Sun, 5 Nov 2017 23:24:59 +0000 (00:24 +0100)]
iio: light: Add driver for IDT ZOPT2201 ambient light and UVB sensor

Driver for 20-bit ALS and UV B sensor with I2C interface exposing
the following API:
  in_uvindex_input
  in_illuminance_raw
  in_illuminance_scale
  in_illuminance_scale_available
  in_intensity_uv_raw
  in_intensity_uv_scale
  in_intensity_uv_scale_available
  integration_time
  integration_time_available

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: core: Mark expected switch fall-through
Gustavo A. R. Silva [Wed, 8 Nov 2017 18:08:26 +0000 (12:08 -0600)]
iio: core: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1397962
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: cros_ec: Remove unused variables
Paolo Cretaro [Sun, 19 Nov 2017 00:57:45 +0000 (01:57 +0100)]
iio: cros_ec: Remove unused variables

Fix gcc warnings about variable 'ec_device' being set but not used
in these files:
common/cros_ec_sensors/cros_ec_sensors.c:194:25
light/cros_ec_light_prox.c:184:25

Signed-off-by: Paolo Cretaro <paolocretaro@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: at91-sama5d2_adc: ack DRDY irq in direct mode
Eugen Hristev [Wed, 15 Nov 2017 12:56:48 +0000 (14:56 +0200)]
iio: adc: at91-sama5d2_adc: ack DRDY irq in direct mode

Need to acknowledge DRDY irq in direct mode/ software
triggered mode. Otherwise, on the next conversion, overrun
flag will be raised, which is not a correct state.
This doesn't affect the functionality, but will generate
possible incorrect overrun reports.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: at91-sama5d2_adc: add support for DMA
Eugen Hristev [Wed, 15 Nov 2017 12:56:47 +0000 (14:56 +0200)]
iio: adc: at91-sama5d2_adc: add support for DMA

Added support for DMA transfers. The implementation uses the user watermark
to decide whether DMA will be used or not. For watermark 1, DMA will not be
used. If watermark is bigger, DMA will be used.
Sysfs attributes are created to indicate whether the DMA is used,
with hwfifo_enabled, and the current DMA watermark is readable
in hwfifo_watermark. Minimum and maximum values are in hwfifo_watermark_min
and hwfifo_watermark_max.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agodt-bindings: iio: at91-sama5d2_adc: add optional dma property
Eugen Hristev [Wed, 15 Nov 2017 12:56:45 +0000 (14:56 +0200)]
dt-bindings: iio: at91-sama5d2_adc: add optional dma property

Added property for DMA configuration of the device.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc/accel: Fix up module licenses
Linus Walleij [Mon, 13 Nov 2017 10:29:55 +0000 (11:29 +0100)]
iio: adc/accel: Fix up module licenses

The module license checker complains about these two so just fix
it up. They are both GPLv2, both written by me or using code
I extracted while refactoring from the GPLv2 drivers.

Cc: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: ipx: depends on NET
Randy Dunlap [Thu, 30 Nov 2017 17:00:03 +0000 (09:00 -0800)]
staging: ipx: depends on NET

IPX depends on NET, so add that to the Kconfig file.

Fixes Kconfig warning and build errors:

warning: (IPX) selects LLC which has unmet direct dependencies (NET)
and 94 "undefined reference" build errors.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ion: reorder include
Benjamin Gaignard [Mon, 6 Nov 2017 15:59:44 +0000 (16:59 +0100)]
staging: ion: reorder include

Put include in alphabetic order

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: Remove a attribute group from a kobject
Arvind Yadav [Sat, 25 Nov 2017 06:39:28 +0000 (12:09 +0530)]
staging: ccree: Remove a attribute group from a kobject

All attribute group created during sys_init_dir() should be removed
in sys_free_dir()

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: address theoretical int overflows
Tim Sell [Fri, 17 Nov 2017 17:27:38 +0000 (12:27 -0500)]
staging: unisys: visorbus: address theoretical int overflows

Add necessary casting to several places where we were doing 32-bit
arithmetic (unsigned) to produce a 64-bit (unsigned long) result, to
prevent the theoretical possibility of a 32-bit overflow during the
arithmetic.

FYI, these are unsigned long:

ctx->param_bytes
ctx->allocbytes

These are unsigned int:

bytes
phdr->name_offset
phdr->name_length

Here is the test program demonstrating why we really need the casts:

void main()
{
unsigned int i;
unsigned long il;

printf("sizeof(int) =%dn",sizeof(i));
printf("sizeof(long)=%dn",sizeof(il));

i = (unsigned int)((((unsigned long)(1)) << 32) - 1);
printf("i                     = %un", i);
il = i+1;
printf("adding 1 withOUT cast = %lun", il);
il = (unsigned long)i+1;
printf("adding 1 WITH    cast = %lun", il);
}
[selltc@mac tmp]$ gcc x.c -o x.out
[selltc@mac tmp]$ ./x.out
sizeof(int) =4
sizeof(long)=8
i                     = 4294967295
adding 1 withOUT cast = 0
adding 1 WITH    cast = 4294967296

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rts5208: remove rtsx_read_pci_cfg_byte()
Sinan Kaya [Mon, 27 Nov 2017 16:58:00 +0000 (11:58 -0500)]
staging: rts5208: remove rtsx_read_pci_cfg_byte()

Remove unused rtsx_read_pci_cfg_byte() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/irda/net: Drop extraneous parentheses around test
Kees Cook [Wed, 22 Nov 2017 20:57:25 +0000 (12:57 -0800)]
staging/irda/net: Drop extraneous parentheses around test

Noticed during Clang builds. This drops the redundant parentheses.

Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8822be: fix missing null check on dev_alloc_skb return
Colin Ian King [Fri, 17 Nov 2017 14:50:55 +0000 (14:50 +0000)]
staging: rtl8822be: fix missing null check on dev_alloc_skb return

dev_alloc_skb can potentially return NULL, so add a null check to
avoid a null pointer dereference on skb

Detected by CoverityScan, CID#1454558 ("Dereference on null return")

Fixes: 7e5b796cde7e ("staging: r8822be: Add the driver code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Fix line over 80 characters
Talat Batheesh [Mon, 27 Nov 2017 13:36:58 +0000 (15:36 +0200)]
staging: lustre: Fix line over 80 characters

This patch fix the line over 80 characters warning that was detected
using checkpatch.pl script.

Signed-off-by: Talat Batheesh <talat.b87@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: Remove a attribute group from a kobject
Arvind Yadav [Sat, 25 Nov 2017 06:39:30 +0000 (12:09 +0530)]
staging: lustre: obdclass: Remove a attribute group from a kobject

All attribute group created during class_procfs_init() should be
removed.
if class_procfs_init() will fail and also in class_procfs_clean().

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ldlm: Remove a attribute group from a kobject
Arvind Yadav [Sat, 25 Nov 2017 06:39:29 +0000 (12:09 +0530)]
staging: lustre: ldlm: Remove a attribute group from a kobject

All attribute group created during ldlm_setup() should be removed
in ldlm_cleanup().

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: pi433_if.c codestyle fix
Oliver Graute [Sun, 26 Nov 2017 20:07:10 +0000 (21:07 +0100)]
staging: pi433: pi433_if.c codestyle fix

This patch fixes the following checkpatch.pl error:

ERROR: spaces required around that '>=' (ctx:VxV)
#930: FILE: pi433_if.c:930:
+ for (i--; i>=0; i--)

ERROR: spaces required around that '=' (ctx:VxV)
#970: FILE: pi433_if.c:970:
+ for (i=0; i<NUM_DIO; i++)

Signed-off-by: Oliver Graute <oliver.graute@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: pi433_if.c fix codestyle on two long lines
Oliver Graute [Mon, 27 Nov 2017 17:34:01 +0000 (18:34 +0100)]
staging: pi433: pi433_if.c fix codestyle on two long lines

This patch fixes the following checkpatch.pl warning:

WARNING: line over 80 characters
#1233: FILE: pi433_if.c:1233:
+               unregister_chrdev(MAJOR(pi433_dev), pi433_spi_driver.driver.name);

WARNING: line over 80 characters
#1240: FILE: pi433_if.c:1240:
+               unregister_chrdev(MAJOR(pi433_dev), pi433_spi_driver.driver.name);

Signed-off-by: Oliver Graute <oliver.graute@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: fix naming when more than one radio is used
Marcin Ciupak [Mon, 20 Nov 2017 23:05:50 +0000 (00:05 +0100)]
staging: pi433: fix naming when more than one radio is used

When using more than one hardware radio module pi433_probe fails as the
same name is used for all modules. Create unique name by adding minor
number to the device name.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: fix (NULL device *) in log message
Marcin Ciupak [Mon, 20 Nov 2017 23:03:57 +0000 (00:03 +0100)]
staging: pi433: fix (NULL device *) in log message

(NULL device *) is printed in log message in pi433_probe and
pi433_get_minor functions due to device->dev being used prior to call to
device_create function.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: fixed signedness of 4th argument to kfifo_from_user
Stefano Manni [Thu, 16 Nov 2017 19:45:26 +0000 (20:45 +0100)]
staging: pi433: fixed signedness of 4th argument to kfifo_from_user

sparse warning:
incorrect type in initializer (different signedness)
expected unsigned int *__copied, got int *<noident>

Signed-off-by: Stefano Manni <stefano.manni@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Fixed coding style issues with braces
Luca Söthe [Sun, 12 Nov 2017 17:59:11 +0000 (18:59 +0100)]
staging: pi433: Fixed coding style issues with braces

Removed a few new lines after enum and struct names
because of the following bracket.

Signed-off-by: Luca Söthe <luca@acul.me>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: remove redundant zero assignment to val32
Colin Ian King [Tue, 7 Nov 2017 19:48:36 +0000 (19:48 +0000)]
staging: rtl8712: remove redundant zero assignment to val32

Variable val32 is being assigned a zero value that is never read
since val32 is being updated immediately afterwards.  Remove this
redundant assignment, cleans up clang warning:

drivers/staging/rtl8712/hal_init.c:339:2: warning: Value stored
to 'val32' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: use 32bits to support 64K size mc-portals
Bharat Bhushan [Wed, 22 Nov 2017 07:48:43 +0000 (13:18 +0530)]
staging: fsl-mc: use 32bits to support 64K size mc-portals

As per APIs each mc-portal is of 64K size while currently
16bits (type u16) is used to store size of mc-portal.
In these cases upper bit of portal size gets truncated.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
Acked-By: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoncpfs: move net/ncpfs to drivers/staging/ncpfs
Stephen Hemminger [Tue, 14 Nov 2017 16:37:15 +0000 (08:37 -0800)]
ncpfs: move net/ncpfs to drivers/staging/ncpfs

The Netware Core Protocol is a file system that talks to
Netware clients over IPX. Since IPX has been dead for many years
move the file system into staging for eventual interment.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoipx: move Novell IPX protocol support into staging
Stephen Hemminger [Tue, 14 Nov 2017 16:37:14 +0000 (08:37 -0800)]
ipx: move Novell IPX protocol support into staging

The Netware IPX protocol is very old and no one should still be using
it. It is time to move it into staging for a while and eventually
decommision it.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/sm750fb: Add "port to atomic kms" to TODO
Daniel Vetter [Tue, 28 Nov 2017 11:47:20 +0000 (12:47 +0100)]
staging/sm750fb: Add "port to atomic kms" to TODO

fbdev is closed for new drivers, drm won't take anything but atomic
drivers.

Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Sudip Mukherjee <sudip@vectorindia.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: imx: use ktime_t for timestamps
Arnd Bergmann [Mon, 27 Nov 2017 13:20:00 +0000 (14:20 +0100)]
staging: imx: use ktime_t for timestamps

The imx media driver passes around monotonic timestamps in the deprecated
'timespec' format. This is not a problem for the driver, as they won't
overflow, but moving to either timespec64 or ktime_t is preferred.

I'm picking ktime_t for simplicity here. frame_interval_monitor() is
the main function that changes, as it tries to compare a time interval
in microseconds. The algorithm slightly changes here, to avoid 64-bit
division. The code previously assumed that the error was at most 32-bit
worth of microseconds here, so I'm making the same assumption but add
an explicit test for it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera use ktime_t for timestamps
Arnd Bergmann [Mon, 27 Nov 2017 13:19:56 +0000 (14:19 +0100)]
staging: bcm2835-camera use ktime_t for timestamps

struct timeval is deprecated for in-kernel use, and converting
this function to use ktime_t makes it simpler as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: make DEVICE_ATTR structures static
Christian Gromm [Mon, 27 Nov 2017 14:20:06 +0000 (15:20 +0100)]
staging: most: make DEVICE_ATTR structures static

In order to limit the scope of the DEVICE_ATTR structure this patch
adds the keywork static.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: remove legacy folders
Christian Gromm [Mon, 27 Nov 2017 14:20:05 +0000 (15:20 +0100)]
staging: most: remove legacy folders

This patch removes the legacy folders of the modules. It is needed
to clean up the driver's source tree.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: fix Makefile
Christian Gromm [Mon, 27 Nov 2017 14:20:04 +0000 (15:20 +0100)]
staging: most: fix Makefile

This patch fixes the names of the CONFIG symbols and the subfolders make
is supposed to enter in order to build the selected modules.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: Remove redundant license text
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:57 +0000 (21:07 +0100)]
staging: android: Remove redundant license text

Now that the SPDX tag is in all android files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: "Arve Hjønnevåg" <arve@android.com>
Cc: Riley Andrews <riandrews@android.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6655: Remove redundant license text
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:56 +0000 (21:07 +0100)]
staging: vt6655: Remove redundant license text

Now that the SPDX tag is in all vt6655 files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6656: Remove redundant license text
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:55 +0000 (21:07 +0100)]
staging: vt6656: Remove redundant license text

Now that the SPDX tag is in all vt6656 files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: add SPDX identifiers to all android driver files
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:54 +0000 (21:07 +0100)]
staging: android: add SPDX identifiers to all android driver files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the android driver files with the correct SPDX license identifier
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: "Arve Hjønnevåg" <arve@android.com>
Cc: Riley Andrews <riandrews@android.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6655: add SPDX identifiers to all vt6655 driver files
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:53 +0000 (21:07 +0100)]
staging: vt6655: add SPDX identifiers to all vt6655 driver files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the vt6655 driver files with the correct SPDX license identifier
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6656: add SPDX identifiers to all vt6656 driver files
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:52 +0000 (21:07 +0100)]
staging: vt6656: add SPDX identifiers to all vt6656 driver files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the vt6656 driver files with the correct SPDX license identifier
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: add SPDX identifiers to all wlan-ng driver files
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:51 +0000 (21:07 +0100)]
staging: wlan-ng: add SPDX identifiers to all wlan-ng driver files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the wlan-ng driver files with the correct SPDX license identifier
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: add SPDX identifiers to all wilc100 files
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:50 +0000 (21:07 +0100)]
staging: wilc1000: add SPDX identifiers to all wilc100 files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the wilc100 driver files with the correct SPDX license identifier
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Ganesh Krishna <ganesh.krishna@microchip.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Aditya Shankar <aditya.shankar@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: xgifb: add SPDX identifiers to the remaining holdout file
Greg Kroah-Hartman [Tue, 7 Nov 2017 20:07:49 +0000 (21:07 +0100)]
staging: xgifb: add SPDX identifiers to the remaining holdout file

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the xgifb/XGI_main_26.c file with the correct SPDX license
identifier based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: Remove redundant license text
Greg Kroah-Hartman [Tue, 7 Nov 2017 13:58:49 +0000 (14:58 +0100)]
staging: unisys: Remove redundant license text

Now that the SPDX tag is in all unisys driver files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: fix up some SPDX tags
Greg Kroah-Hartman [Tue, 7 Nov 2017 13:58:48 +0000 (14:58 +0100)]
staging: unisys: fix up some SPDX tags

One .h file was missing a SPDX tag, and another one was wrong after
looking at the text of the license itself, so fix both of these issues
up at the same time.

Cc: David Kershner <david.kershner@unisys.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: add SPDX identifiers to all unisys driver files
Greg Kroah-Hartman [Tue, 7 Nov 2017 13:58:47 +0000 (14:58 +0100)]
staging: unisys: add SPDX identifiers to all unisys driver files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/staging/unisys files files with the correct SPDX
license identifier based on the license text in the file itself.  The
SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: David Kershner <david.kershner@unisys.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: Remove redundant license text
Greg Kroah-Hartman [Tue, 7 Nov 2017 13:58:45 +0000 (14:58 +0100)]
staging: comedi: Remove redundant license text

Now that the SPDX tag is in all comedi files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: drivers: Remove redundant license text
Greg Kroah-Hartman [Tue, 7 Nov 2017 13:58:44 +0000 (14:58 +0100)]
staging: comedi: drivers: Remove redundant license text

Now that the SPDX tag is in all comedi files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: add SPDX identifiers to all greybus driver files
Greg Kroah-Hartman [Tue, 7 Nov 2017 13:58:43 +0000 (14:58 +0100)]
staging: comedi: add SPDX identifiers to all greybus driver files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/staging/comedi files files with the correct SPDX
license identifier based on the license text in the file itself.  The
SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc-bus: fix build warning
Greg Kroah-Hartman [Mon, 27 Nov 2017 08:25:51 +0000 (09:25 +0100)]
staging: fsl-mc-bus: fix build warning

error could be unitialized when it is used as a return value in
fsl_mc_device_add().  So fix up the warning by properly setting it.

Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: use device_type instead of strcmp()
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:34 +0000 (15:38 +0200)]
staging: fsl-mc: use device_type instead of strcmp()

Replace strcmp() based device type checks with the standard device
model type.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: add support for device type
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:33 +0000 (15:38 +0200)]
staging: fsl-mc: add support for device type

The MC bus has different types of devices and this is supported by
device model. This patch adds initial support for device types
(defines them, adds helpers and sets the device type).

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: remove debug WARN_ONs doubling error checks
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:32 +0000 (15:38 +0200)]
staging: fsl-mc: remove debug WARN_ONs doubling error checks

A lot of error checks are doubled by debug WARN_ONs. Given that the
driver was thoroughly debugged and is in a stable state, it's time to
drop them.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: remove some superfluous WARN_ONs
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:31 +0000 (15:38 +0200)]
staging: fsl-mc: remove some superfluous WARN_ONs

These WARN_ONs shouldn't trigger unless something went very wrong.
Since the driver is in a stable state let's remove these debug
WARN_ONs.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: change to use EXPORT_SYMBOL_GPL()
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:30 +0000 (15:38 +0200)]
staging: fsl-mc/dpio: change to use EXPORT_SYMBOL_GPL()

No need to use EXPORT_SYMBOL() so switch to the GPL variant.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: consistently use EXPORT_SYMBOL_GPL()
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:29 +0000 (15:38 +0200)]
staging: fsl-mc: consistently use EXPORT_SYMBOL_GPL()

The bus driver is mixing EXPORT_SYMBOL()/EXPORT_SYMBOL_GPL() usage.
Change it to consistently use EXPORT_SYMBOL_GPL().

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: remove couple of unused functions
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:28 +0000 (15:38 +0200)]
staging: fsl-mc/dpio: remove couple of unused functions

These couple of functions are not yet used so lets remove them
for now and add them back when/if needed.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: drop EXPORT_SYMBOL() for a few functions
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:27 +0000 (15:38 +0200)]
staging: fsl-mc/dpio: drop EXPORT_SYMBOL() for a few functions

These functions are only used within this driver so no need for
EXPORT_SYMBOL().

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: remove incomplete refcount implementation
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:26 +0000 (15:38 +0200)]
staging: fsl-mc/dpio: remove incomplete refcount implementation

There's an unfinished implementation of reference counting for dpaa2_io
structure using atomics. Since it's unused lets remove it for now and,
if needed at a later time, make use of krefs instead of rolling our
own refcounting.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: drop unused dpcon APIs
Laurentiu Tudor [Fri, 17 Nov 2017 13:38:25 +0000 (15:38 +0200)]
staging: fsl-mc: drop unused dpcon APIs

Couple of API functions are not used so lets drop them together with
the associated structures and defines.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: usbdux: remove redundant initialization of val
Colin Ian King [Tue, 7 Nov 2017 19:07:24 +0000 (19:07 +0000)]
staging: comedi: usbdux: remove redundant initialization of val

The early initialization of val is redundant as the value is never
read and is updated inside a for-loop. Remove the initialization
and move the declaration and initialization to the for-loop scope.
Cleans up clang warning:

drivers/staging/comedi/drivers/usbdux.c:812:15: warning: Value stored
to 'val' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: speakup: selection: replace _manual_ swap with swap macro
Gustavo A. R. Silva [Fri, 10 Nov 2017 22:13:03 +0000 (16:13 -0600)]
staging: speakup: selection: replace _manual_ swap with swap macro

Make use of the swap macro instead of _manually_ swapping values
and remove unnecessary variable tmp.

This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: rtlwifi: use ktime_get_real_seconds() for suspend time
Arnd Bergmann [Tue, 7 Nov 2017 10:43:34 +0000 (11:43 +0100)]
staging: rtlwifi: rtlwifi: use ktime_get_real_seconds() for suspend time

do_gettimeofday() is deprecated and slower than necessary for the purpose
of reading the seconds. This changes rtl_op_suspend/resume to use
ktime_get_real_seconds() instead, which is simpler and avoids confusion
about whether it is y2038-safe or not.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: remove redundant assignments to ul_enc_algo
Colin Ian King [Wed, 8 Nov 2017 13:30:31 +0000 (13:30 +0000)]
staging: rtlwifi: remove redundant assignments to ul_enc_algo

Variable ul_enc_algo is being initialized with a value that is never
read, it is being set again in the following switch statements in
all of the case and default paths. Hence the unitialization is
redundant and can be removed.  Cleans up two clang warnings:

Value stored to 'ul_enc_algo' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: dgnc: Fix usleep_range is preferred over udelay
Joshua Abraham [Tue, 7 Nov 2017 18:24:25 +0000 (13:24 -0500)]
staging: dgnc: Fix usleep_range is preferred over udelay

This patch fixes the issue:

CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt

Signed-off-by: Joshua Abraham <j.abraham1776@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix incorrect indentation of break statement
Colin Ian King [Fri, 17 Nov 2017 18:19:08 +0000 (18:19 +0000)]
staging: ccree: fix incorrect indentation of break statement

The break statement is indented one level too many, fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: drop unused macro
Gilad Ben-Yossef [Mon, 13 Nov 2017 14:45:52 +0000 (14:45 +0000)]
staging: ccree: drop unused macro

The CC_REG_NAME macro is unused. Drop it.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: use local vars for readability
Gilad Ben-Yossef [Mon, 13 Nov 2017 14:45:51 +0000 (14:45 +0000)]
staging: ccree: use local vars for readability

Refactor cc_map_aead_request() to use local vars for addresses
for better readability of code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: replace msleep with a completion
Gilad Ben-Yossef [Mon, 13 Nov 2017 14:45:50 +0000 (14:45 +0000)]
staging: ccree: replace msleep with a completion

When the driver would try to queue commands to the HW FIFO but ran out of
slots it would use msleep as a delay until the FIFO would clear. This is
messy and not accurate.

Replace the msleep with a proper completion on the event of command
completion which should indicate at least one slot is free.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove unused field
Gilad Ben-Yossef [Mon, 13 Nov 2017 14:45:49 +0000 (14:45 +0000)]
staging: ccree: remove unused field

Field monitor_null_cycles of struct drvdata was not being used.
Remove it.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove unneeded wrapper function
Gilad Ben-Yossef [Mon, 13 Nov 2017 14:45:48 +0000 (14:45 +0000)]
staging: ccree: remove unneeded wrapper function

Remove unneeded wrapper function to simplify code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: rename long define for readability
Gilad Ben-Yossef [Mon, 13 Nov 2017 14:45:47 +0000 (14:45 +0000)]
staging: ccree: rename long define for readability

Rename the too long  SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE
to SSI_MAX_OPAD_KEYS_SIZE for better code readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>