platform/kernel/linux-rpi.git
5 years agoiio: magnetometer: mmc35240: Fix a typo in the name of a constant
Christophe JAILLET [Sun, 21 Jul 2019 21:35:33 +0000 (23:35 +0200)]
iio: magnetometer: mmc35240: Fix a typo in the name of a constant

Everything is about mmc35240_ except MMC53240_WAIT_SET_RESET (3 and 5
switched).

This is likely a typo. Define and use MMC35240_WAIT_SET_RESET instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: pressure: hp03: convert to i2c_new_dummy_device
Wolfram Sang [Mon, 22 Jul 2019 17:26:13 +0000 (19:26 +0200)]
iio: pressure: hp03: convert to i2c_new_dummy_device

Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: light: veml6070: convert to i2c_new_dummy_device
Wolfram Sang [Mon, 22 Jul 2019 17:26:12 +0000 (19:26 +0200)]
iio: light: veml6070: convert to i2c_new_dummy_device

Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: light: cm36651: convert to i2c_new_dummy_device
Wolfram Sang [Mon, 22 Jul 2019 17:26:11 +0000 (19:26 +0200)]
iio: light: cm36651: convert to i2c_new_dummy_device

Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: imu: add bindings for ADIS16460
Alexandru Ardelean [Tue, 23 Jul 2019 07:36:40 +0000 (10:36 +0300)]
dt-bindings: iio: imu: add bindings for ADIS16460

This change adds device-tree bindings for the ADIS16460.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: Add support for the ADIS16460 IMU
Alexandru Ardelean [Tue, 23 Jul 2019 07:36:39 +0000 (10:36 +0300)]
iio: imu: Add support for the ADIS16460 IMU

The ADIS16460 device is a complete inertial system that includes a triaxial
gyroscope and a triaxial accelerometer. It's more simplified design than
that of the ADIS16480, and does not offer the triaxial magnetometers &
pressure sensors. It does also have a temperature sensor (like the
ADIS16480).
Since it is part of the ADIS16XXX family, it re-uses parts of the ADIS
library.

Naturally, the register map is different and much more simplified than the
ADIS16480 subfamily, so it cannot be integrated into that driver. A major
difference is that the registers are not paged.

One thing that is particularly special about it, is that it requires a
higher delay between CS changes (i.e. when CS goes up, the spec recommends
that it be brought down after a minimum of 16 uS).
Other ADIS chips require (via spec) a minimum of 2 uS between CS changes.
The kernel's 10 uS default should be fine for those other chips; they
haven't been tested with lower CS change delays yet.

Datasheet:
  https://www.analog.com/media/en/technical-documentation/data-sheets/adis16460.pdf

Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: adis: Add support for SPI transfer cs_change_delay
Alexandru Ardelean [Tue, 23 Jul 2019 07:36:38 +0000 (10:36 +0300)]
iio: imu: adis: Add support for SPI transfer cs_change_delay

The ADIS16460 requires a higher delay before the next transfer. Since the
SPI framework supports configuring the delay before the next transfer, this
driver will become the first user of it.

The support for this functionality in ADIS16460 requires an addition to the
ADIS lib to support the `cs_change_delay` functionality from the SPI
subsystem.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: mxc4005: Use device-managed APIs
Chuhong Yuan [Fri, 26 Jul 2019 06:36:16 +0000 (14:36 +0800)]
iio: mxc4005: Use device-managed APIs

Use device-managed APIs to simplify the code.
The remove function is redundant now and can
be deleted.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: humidity: Use device-managed APIs
Chuhong Yuan [Fri, 26 Jul 2019 08:02:55 +0000 (16:02 +0800)]
iio: humidity: Use device-managed APIs

Use device-managed APIs to simplify the code.
The remove functions are redundant now and can
be deleted.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agostaging: iio: ad2s1210: Use device-managed API
Chuhong Yuan [Fri, 26 Jul 2019 11:07:42 +0000 (19:07 +0800)]
staging: iio: ad2s1210: Use device-managed API

Use device-managed API to simplify the code.
The remove function is redundant now and can
be deleted.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: maxim_thermocouple: Use device-managed APIs
Chuhong Yuan [Fri, 26 Jul 2019 10:49:50 +0000 (18:49 +0800)]
iio: maxim_thermocouple: Use device-managed APIs

Use device-managed APIs to simplify the code.
The remove functions are redundant now and can
be deleted.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: make st_sensors drivers use regmap
Denis Ciocca [Thu, 18 Jul 2019 22:53:53 +0000 (15:53 -0700)]
iio: make st_sensors drivers use regmap

This patch is meant to replace the i2c/spi transfer functions with
regmap. SPI framework requires DMA safe buffers so let's add GFP_DMA
flag for memory allocation used by bulk_read functions.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: move 3-wire spi initialization to st_sensors_spi
Denis Ciocca [Thu, 18 Jul 2019 22:53:52 +0000 (15:53 -0700)]
iio: move 3-wire spi initialization to st_sensors_spi

Some devices need to be configured with special bit in order to
use spi 3-wire. This was done during device identification phase.
Instead, let's move this part as spi specific.
Doing this the check_device_support function becomes a simple
device id check, so let's rename it.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:pressure: device settings are set immediately during probe
Denis Ciocca [Thu, 18 Jul 2019 22:53:51 +0000 (15:53 -0700)]
iio:pressure: device settings are set immediately during probe

This patch set pressure settings right after probe start. This is
done in preparation of regmap that needs different configuration
based on multiread bit value.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:magn: device settings are set immediately during probe
Denis Ciocca [Thu, 18 Jul 2019 22:53:50 +0000 (15:53 -0700)]
iio:magn: device settings are set immediately during probe

This patch set magn settings right after probe start. This is
done in preparation of regmap that needs different configuration
based on multiread bit value.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:gyro: device settings are set immediately during probe
Denis Ciocca [Thu, 18 Jul 2019 22:53:49 +0000 (15:53 -0700)]
iio:gyro: device settings are set immediately during probe

This patch set gyro settings right after probe start. This is
done in preparation of regmap that needs different configuration
based on multiread bit value.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:accel: device settings are set immediately during probe
Denis Ciocca [Thu, 18 Jul 2019 22:53:48 +0000 (15:53 -0700)]
iio:accel: device settings are set immediately during probe

This patch set accel settings right after probe start. This is
done in preparation of regmap that needs different configuration
based on multiread bit value.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:pressure: introduce st_press_get_settings() function
Denis Ciocca [Thu, 18 Jul 2019 22:53:47 +0000 (15:53 -0700)]
iio:pressure: introduce st_press_get_settings() function

The function is introduced to retrieve press device settings. It will be
used by probe in order to configure regmap.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:magn: introduce st_magn_get_settings() function
Denis Ciocca [Thu, 18 Jul 2019 22:53:46 +0000 (15:53 -0700)]
iio:magn: introduce st_magn_get_settings() function

The function is introduced to retrieve magn device settings. It will be
used by probe in order to configure regmap.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:gyro: introduce st_gyro_get_settings() function
Denis Ciocca [Thu, 18 Jul 2019 22:53:45 +0000 (15:53 -0700)]
iio:gyro: introduce st_gyro_get_settings() function

The function is introduced to retrieve gyro device settings. It will be
used by probe in order to configure regmap.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:accel: introduce st_accel_get_settings() function
Denis Ciocca [Thu, 18 Jul 2019 22:53:44 +0000 (15:53 -0700)]
iio:accel: introduce st_accel_get_settings() function

The function is introduced to retrieve accel device settings. It will be
used by probe in order to configure regmap.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:common:st_sensors: add st_sensors_get_settings_index() helper function
Denis Ciocca [Thu, 18 Jul 2019 22:53:43 +0000 (15:53 -0700)]
iio:common:st_sensors: add st_sensors_get_settings_index() helper function

Extract from st_sensors_check_device_support() function the code that
is used to get the specific settings for a device. This will be used
as generic extractor by each ST driver.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: cros_ec: Remove replacing error code with -EIO
Gwendal Grignou [Thu, 18 Jul 2019 22:22:37 +0000 (15:22 -0700)]
iio: cros_ec: Remove replacing error code with -EIO

Due to an API misread, error code can be different for -EIO when reading
a sysfs entry. Return the error reported by the cros_ec stack.

Check the proper error message (protocol error, not supported) is
reported when there is an error returned by the EC stack.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: cros_ec: Add calibscale for 3d MEMS
Gwendal Grignou [Thu, 18 Jul 2019 23:28:24 +0000 (16:28 -0700)]
iio: cros_ec: Add calibscale for 3d MEMS

Add calibration scale support to accel, gyro and magnetometer.

Check on eve with current firmware, check reading calibscale returns 1.0,
check with newer firmware values are applied.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: light: apds9960: Fix a typo
Christophe JAILLET [Sun, 21 Jul 2019 10:49:18 +0000 (12:49 +0200)]
iio: light: apds9960: Fix a typo

s/ADPS9960/APDS9960/
(P and D switched)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: sca3000: Fix a typo
Christophe JAILLET [Sun, 21 Jul 2019 10:53:53 +0000 (12:53 +0200)]
iio: sca3000: Fix a typo

All #define are about SCA3000_... except the last one.
Make it consistent.

s/SAC3000/SCA3000/

This #define is apparently unused up to now.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoIIO: stm32: Remove quadrature related functions from trigger driver
Benjamin Gaignard [Tue, 7 May 2019 09:12:24 +0000 (11:12 +0200)]
IIO: stm32: Remove quadrature related functions from trigger driver

Quadrature feature is now hosted on it own framework.
Remove quadrature related code from stm32-trigger driver to avoid
code duplication and simplify the ABI.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agostaging: iio: ad7192: create of_device_id array
Bárbara Fernandes [Fri, 28 Jun 2019 19:49:22 +0000 (16:49 -0300)]
staging: iio: ad7192: create of_device_id array

Create list of compatible device ids to be matched with those stated in
the device tree.

Signed-off-by: Bárbara Fernandes <barbara.fernandes@usp.br>
Signed-off-by: Wilson Sales <spoonm@spoonm.org>
Co-developed by: Wilson Sales <spoonm@spoonm.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: imu: st_lsm6dsx: add lsm6ds3tr-c device bindings
Lorenzo Bianconi [Sat, 29 Jun 2019 10:13:54 +0000 (12:13 +0200)]
dt-bindings: iio: imu: st_lsm6dsx: add lsm6ds3tr-c device bindings

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: st_lsm6dsx: add support to LSM6DS3TR-C
Lorenzo Bianconi [Sat, 29 Jun 2019 10:13:53 +0000 (12:13 +0200)]
iio: imu: st_lsm6dsx: add support to LSM6DS3TR-C

Add support to STM LSM6DS3TR-C 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6ds3tr-c.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoDocumentation: ABI: iio: Add missing newline at end of file
Geert Uytterhoeven [Mon, 1 Jul 2019 13:56:31 +0000 (15:56 +0200)]
Documentation: ABI: iio: Add missing newline at end of file

"git diff" says:

    \ No newline at end of file

after modifying the files.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: stm32-adc: add analog switches supply control
Fabrice Gasnier [Wed, 3 Jul 2019 10:08:15 +0000 (12:08 +0200)]
iio: adc: stm32-adc: add analog switches supply control

On stm32h7 and stm32mp1, the ADC inputs are multiplexed with analog
switches which have reduced performances when their supply is below 2.7V
(vdda by default):
- 3.3V embedded booster can be used, to get full ADC performances
  (increases power consumption).
- vdd supply can be selected if above 2.7V by setting ANASWVDD syscfg bit,
  on STM32MP1 only.

Make this optional, since this is a trade-off between analog performance
and power consumption.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: adc: stm32: add analog switches supply control
Fabrice Gasnier [Wed, 3 Jul 2019 10:08:14 +0000 (12:08 +0200)]
dt-bindings: iio: adc: stm32: add analog switches supply control

On stm32h7 and stm32mp1, the ADC inputs are multiplexed with analog
switches which have reduced performances when their supply is below 2.7V
(vdda by default). Booster or vdd can be used, to get full ADC
performances.

Add documentation for:
- optional booster-supply that can be used on stm32h7 and stm32mp1.
- optional vdd-supply that can be used on stm32mp1 to supply analog
  circuitry, selected by syscfg.
Mark these as optional, since this is a trade-off between analog
performance and power consumption.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: light: stk3310: Add device tree support
Luca Weiss [Wed, 3 Jul 2019 18:05:59 +0000 (20:05 +0200)]
iio: light: stk3310: Add device tree support

Add device tree support for the stk33xx family of ambient light sensors.

Tested-by: Martijn Braam <martijn@brixit.nl>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: light: add stk33xx
Luca Weiss [Wed, 3 Jul 2019 18:05:58 +0000 (20:05 +0200)]
dt-bindings: iio: light: add stk33xx

Add binding documentation for the stk33xx family of ambient light
sensors.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: Add vendor prefix for sensortek
Luca Weiss [Wed, 3 Jul 2019 18:05:57 +0000 (20:05 +0200)]
dt-bindings: Add vendor prefix for sensortek

Sensortek Technology Corp. produces Proximity Sensors with ALS and
Accelerometers.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: mpu6050: Replace devm_add_action() followed by failure action with devm_add...
Fuqian Huang [Mon, 8 Jul 2019 12:33:41 +0000 (20:33 +0800)]
iio: imu: mpu6050: Replace devm_add_action() followed by failure action with devm_add_action_or_reset()

devm_add_action_or_reset() is introduced as a helper function which
internally calls devm_add_action(). If devm_add_action() fails
then it will execute the action mentioned and return the error code.
This reduce source code size (avoid writing the action twice)
and reduce the likelyhood of bugs.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: sc27xx: Replace devm_add_action() followed by failure action with devm_add_...
Fuqian Huang [Mon, 8 Jul 2019 12:32:43 +0000 (20:32 +0800)]
iio: adc: sc27xx: Replace devm_add_action() followed by failure action with devm_add_action_or_reset()

devm_add_action_or_reset() is introduced as a helper function which
internally calls devm_add_action(). If devm_add_action() fails
then it will execute the action mentioned and return the error code.
This reduce source code size (avoid writing the action twice)
and reduce the likelyhood of bugs.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: sc27xx: Introduce local variable 'struct device *dev'
Fuqian Huang [Mon, 8 Jul 2019 12:32:21 +0000 (20:32 +0800)]
iio: adc: sc27xx: Introduce local variable 'struct device *dev'

Introduce local variable 'struct device *dev' and use it instead of
dereferencing it repeatly.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoMAINTAINERS: add entry for plantower pms7003 driver
Tomasz Duszynski [Wed, 10 Jul 2019 19:21:55 +0000 (21:21 +0200)]
MAINTAINERS: add entry for plantower pms7003 driver

Add myself as a plantower pms7003 driver maintainer.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: chemical: pms7003: convert bindings to yaml
Tomasz Duszynski [Wed, 10 Jul 2019 19:21:54 +0000 (21:21 +0200)]
dt-bindings: iio: chemical: pms7003: convert bindings to yaml

Convert existing device tree bindings to yaml.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agostaging: rtl8192*: display ESSIDs using %pE
J. Bruce Fields [Wed, 10 Jul 2019 22:59:34 +0000 (18:59 -0400)]
staging: rtl8192*: display ESSIDs using %pE

Everywhere else in the kernel ESSIDs are printed using %pE, and I can't
see why there should be an exception here.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Link: https://lore.kernel.org/r/1562799574-13315-1-git-send-email-bfields@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: Remove unneeded variable pU1Tmp
Hariprasad Kelam [Thu, 25 Jul 2019 03:23:25 +0000 (08:53 +0530)]
staging: rtl8723bs: hal: Remove unneeded variable pU1Tmp

Both pu8 and pU1Tmp are of same data type u8. So replace pU1Tmp with u8.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190725032325.GA16473@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove unused function prototype ODM_SetAntenna()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:45 +0000 (10:56 +0530)]
staging: rtl8723bs: Remove unused function prototype ODM_SetAntenna()

Remove unused function prototype ODM_SetAntenna.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-9-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Replace function ODM_TXPowerTrackingCheck()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:44 +0000 (10:56 +0530)]
staging: rtl8723bs: Replace function ODM_TXPowerTrackingCheck()

Remove function ODM_TXPowerTrackingCheck as all it does is call
odm_TXPowerTrackingCheckCE.
Rename odm_TXPowerTrackingCheckCE to ODM_TXPowerTrackingCheck to
maintain compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-8-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Replace function odm_TXPowerTrackingInit()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:43 +0000 (10:56 +0530)]
staging: rtl8723bs: Replace function odm_TXPowerTrackingInit()

Remove function odm_TXPowerTrackingInit as all it does is call
odm_TXPowerTrackingThermalMeterInit.
Rename odm_TXPowerTrackingThermalMeterInit to
odm_TXPowerTrackingInit to maintain compatibility with call sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-7-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Replace function beacon_timing_control()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:42 +0000 (10:56 +0530)]
staging: rtl8723bs: Replace function beacon_timing_control()

Remove function beacon_timing_control as it does nothing except call
rtw_hal_bcn_related_reg_setting.
Rename rtw_hal_bcn_related_reg_setting to beacon_timing_control to
maintain compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-6-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: Replace function rtl8723b_set_ap_wowlan_cmd()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:41 +0000 (10:56 +0530)]
staging: rtl8723bs: hal: Replace function rtl8723b_set_ap_wowlan_cmd()

Remove function rtl8723b_set_ap_wowlan_cmd as all it does is call
rtl8723b_set_AP_FwWoWlanRelated_cmd.
Rename rtl8723b_set_AP_FwWoWlanRelated_cmd to
rtl8723b_set_ap_wowlan_cmd to maintain compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-5-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: Replace function rtl8723b_set_wowlan_cmd()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:40 +0000 (10:56 +0530)]
staging: rtl8723bs: hal: Replace function rtl8723b_set_wowlan_cmd()

Remove function rtl8723b_set_wowlan_cmd as all it does is call
rtl8723b_set_FwWoWlanRelated_cmd.
Rename rtl8723b_set_FwWoWlanRelated_cmd to rtl8723b_set_wowlan_cmd to
maintain compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-4-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: Replace function PHY_GetTxPowerIndex()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:39 +0000 (10:56 +0530)]
staging: rtl8723bs: hal: Replace function PHY_GetTxPowerIndex()

Remove function PHY_GetTxPowerIndex as it does nothing except call
PHY_GetTxPowerIndex_8723B.
Rename PHY_GetTxPowerIndex_8723B to PHY_GetTxPowerIndex to maintain
compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-3-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: Replace function PHY_SetTxPowerIndex()
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:38 +0000 (10:56 +0530)]
staging: rtl8723bs: hal: Replace function PHY_SetTxPowerIndex()

Remove function PHY_SetTxPowerIndex as it does nothing except call
PHY_SetTxPowerIndex_8723B.
Rename PHY_SetTxPowerIndex_8723B to PHY_SetTxPowerIndex to maintain
compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-2-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: rtw_pwrctrl: Change true/false checks
Nishka Dasgupta [Thu, 25 Jul 2019 05:26:37 +0000 (10:56 +0530)]
staging: rtl8723bs: rtw_pwrctrl: Change true/false checks

Change comparisons to true to the variable itself.
Change comparisons to false to the negation of the variable.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052645.2372-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodrivers/staging/rtl8192u: fix indentation issue, remove extra tab
Colin Ian King [Tue, 23 Jul 2019 14:50:22 +0000 (15:50 +0100)]
drivers/staging/rtl8192u: fix indentation issue, remove extra tab

A statement is indented one level too deeply; clean this up by
removing a tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190723145022.11608-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-pci: avoid use 'err' local variable
Sergio Paracuellos [Sat, 20 Jul 2019 07:29:08 +0000 (09:29 +0200)]
staging: mt7621-pci: avoid use 'err' local variable

Function 'mt7621_pcie_request_resources' is using 'err'
local variable to get value returned from 'devm_request_pci_bus_resources'
and returning after that. This is not needed at all. Instead of that
just directly return returned value by the function which is also
returning zero on success.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20190720072908.16795-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8192e: remove set but not used variable 'payload '
YueHaibing [Wed, 17 Jul 2019 14:35:51 +0000 (22:35 +0800)]
staging: rtl8192e: remove set but not used variable 'payload '

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8192e/rtllib_rx.c: In function rtllib_rx_InfraAdhoc:
drivers/staging/rtl8192e/rtllib_rx.c:1303:6: warning:
 variable payload set but not used [-Wunused-but-set-variable]

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190717143551.29200-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: remove redundant assignment to variable n
Colin Ian King [Tue, 23 Jul 2019 14:59:05 +0000 (15:59 +0100)]
staging: rtl8723bs: hal: remove redundant assignment to variable n

The variable n is being assigned a value that is never read, the
assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190723145905.13514-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: remove unused file hal_phy.c
Michael Straube [Sun, 21 Jul 2019 17:57:35 +0000 (19:57 +0200)]
staging: rtl8723bs: remove unused file hal_phy.c

Remove the unused file hal_phy.c. No function from this file is used
in the driver code and it is not listed in the Makefile.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20190721175735.24173-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Remove Unneeded variable ret
Hariprasad Kelam [Wed, 17 Jul 2019 18:06:35 +0000 (23:36 +0530)]
staging: rtl8723bs: core: Remove Unneeded variable ret

Remove Unneeded variable ret . Return _FAIL .

We cannot change return type of on_action_spct as its callback function.

Issue identified with coccicheck.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190717180635.GA11412@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: os_dep: change return type of rtw_suspend_ap_wow
Hariprasad Kelam [Wed, 17 Jul 2019 17:56:43 +0000 (23:26 +0530)]
staging: rtl8723bs: os_dep: change return type of rtw_suspend_ap_wow

Change return type of rtw_suspend_ap_wow as its always return SUCCCESS.

Issue found with coccicheck

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190717175642.GA10582@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: remove set but not used variable 'cck_highpwr'
YueHaibing [Wed, 17 Jul 2019 14:20:14 +0000 (22:20 +0800)]
staging: rtl8723bs: remove set but not used variable 'cck_highpwr'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/hal/odm_HWConfig.c:
 In function odm_RxPhyStatus92CSeries_Parsing:
drivers/staging/rtl8723bs/hal/odm_HWConfig.c:92:5: warning:
 variable cck_highpwr set but not used [-Wunused-but-set-variable]

It is never used and can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190717142014.43216-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: r8712_free_recvframe(): Change return type
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:41 +0000 (14:53 +0530)]
staging: rtl8712: r8712_free_recvframe(): Change return type

Change return type of r8712_free_recvframe from int to void as it always
returns _SUCCESS and its return value is never used.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-8-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: r8712_init_recvbuf(): Change return type
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:40 +0000 (14:53 +0530)]
staging: rtl8712: r8712_init_recvbuf(): Change return type

Change return type of r8712_init_recvbuf from int to void as it always
returned _SUCCESS and this return value was never used at any call site.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-7-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: r8712_set_802_11_add_wep(): Change return values
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:39 +0000 (14:53 +0530)]
staging: rtl8712: r8712_set_802_11_add_wep(): Change return values

Change call sites of r8712_set_802_11_add_wep to check for 0 and
non-zero values (e.g -EINVAL, -ENOMEM) instead of for _SUCCESS and
_FAIL.
Change return values of r8712_set_802_11_add_wep from true and false and
_SUCCESS to -EINVAL and the return value of r8712_set_key.
Change return type from u8 to int to accommodate these new return
values.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-6-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: init_mp_priv(): Change return values
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:38 +0000 (14:53 +0530)]
staging: rtl8712: init_mp_priv(): Change return values

Change return values of init_mp_priv from _SUCCESS/_FAIL to 0/-ENOMEM
respectively.
Remove label that returns the required value and return the values
directly as they are set.
Consequently remove now-unnecessary return variable.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-5-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: r8712_register_cmd_alive(): Change return values
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:37 +0000 (14:53 +0530)]
staging: rtl8712: r8712_register_cmd_alive(): Change return values

Change return values of r8712_register_cmd_alive from _SUCCESS and _FAIL
to 0 and -EINVAL.
Change the return type of this function from sint to int.
Modify its call site to check for 0 instead of _SUCCESS.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-4-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: r8712_set_key(): Change return values
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:36 +0000 (14:53 +0530)]
staging: rtl8712: r8712_set_key(): Change return values

Change return values of r8712_set_key from _SUCCESS and _FAIL to 0 and
-ENOMEM or -EINVAL, as the case may require.
Modify return statements and return variable accordingly.
Change return type from sint to int.
As there is only one site where the return value is used, update that
call site according to the change in the return values.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-3-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: r8712_set_auth(): Change return values
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:35 +0000 (14:53 +0530)]
staging: rtl8712: r8712_set_auth(): Change return values

Change return values of r8712_set_auth from _SUCCESS/_FAIL to 0/-ENOMEM
respectively. Modify call site accordingly. Also change return type of
the function from sint to int.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-2-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: r8712_init_mlme_priv(): Change return values
Nishka Dasgupta [Mon, 22 Jul 2019 09:23:34 +0000 (14:53 +0530)]
staging: rtl8712: r8712_init_mlme_priv(): Change return values

Change return values of r8712_init_mlme_priv from _SUCCESS/_FAIL to
0/-ENOMEM respectively. Modify call site accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: Merge memcpy + be16_to_cpus to get_unaligned_be16
Chuhong Yuan [Fri, 19 Jul 2019 07:09:22 +0000 (15:09 +0800)]
staging: rtl8712: Merge memcpy + be16_to_cpus to get_unaligned_be16

Merge the combo of memcpy and be16_to_cpus.
Use get_unaligned_be16 instead.
This simplifies the code.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20190719070921.27749-1-hslester96@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: recv_linux.c: Align * on block comment
Christian L Moreno [Tue, 16 Jul 2019 19:09:15 +0000 (16:09 -0300)]
staging: rtl8712: recv_linux.c: Align * on block comment

Block comments should align the * on each line.
This warning was reported by checkpatch.pl

Signed-off-by: Christian L Moreno <christianluciano.m@gmail.com>
Link: https://lore.kernel.org/r/20190716190915.30869-1-christianluciano.m@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32
Chuhong Yuan [Thu, 25 Jul 2019 02:52:03 +0000 (10:52 +0800)]
staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32

Merge the combo use of memcpy and le32_to_cpus.
Use get_unaligned_le32 instead.
This simplifies the code.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20190725025203.8772-1-hslester96@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: comedi: daqboard2000: Remove function db2k_initialize_dac()
Nishka Dasgupta [Thu, 25 Jul 2019 05:23:59 +0000 (10:53 +0530)]
staging: comedi: daqboard2000: Remove function db2k_initialize_dac()

Remove function db2k_initialize_dac as all it does is call
db2k_dac_disarm.
Modify call site accordingly.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725052359.2308-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: android: ion: Remove unused rbtree for ion_buffer
Lecopzer Chen [Fri, 12 Jul 2019 08:47:17 +0000 (16:47 +0800)]
staging: android: ion: Remove unused rbtree for ion_buffer

ion_buffer_add() insert ion_buffer into rbtree every time creating
an ion_buffer but never use it after ION reworking.
Also, buffer_lock protects only rbtree operation, remove it together.

Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Cc: YJ Chiang <yj.chiang@mediatek.com>
Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Link: https://lore.kernel.org/r/20190712084717.12441-1-lecopzer.chen@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-pinctrl: Add of_node_put() before return
Nishka Dasgupta [Tue, 16 Jul 2019 05:59:08 +0000 (11:29 +0530)]
staging: mt7621-pinctrl: Add of_node_put() before return

Each iteration of for_each_compatible_node puts the previous node, but
in the case of a return from the middle of the loop, there is no put,
thus causing a memory leak. Add an of_node_put before the return.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190716055908.3183-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-pci: Add of_node_put() before return
Nishka Dasgupta [Tue, 16 Jul 2019 05:59:44 +0000 (11:29 +0530)]
staging: mt7621-pci: Add of_node_put() before return

Each iteration of for_each_available_child_of_node puts the previous
node, but in the case of a return from the middle of the loop, there is
no put, thus causing a memory leak. Hence add an of_node_put before the
return in two places.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190716055944.3237-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: support bmap
Chao Yu [Tue, 16 Jul 2019 09:32:56 +0000 (17:32 +0800)]
staging: erofs: support bmap

Add erofs_bmap() to support FIBMAP ioctl on flatmode inode.

Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20190716093256.108791-1-yuchao0@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: avoid opened loop codes
Chao Yu [Tue, 16 Jul 2019 09:44:22 +0000 (17:44 +0800)]
staging: erofs: avoid opened loop codes

Use __GFP_NOFAIL to avoid opened loop codes in z_erofs_vle_unzip().

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190716094422.110805-1-yuchao0@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: change alignment to match parenthesis
Benjamin Sherman [Tue, 16 Jul 2019 04:57:55 +0000 (00:57 -0400)]
staging: vt6656: change alignment to match parenthesis

Change indentation to match parentheses.  This complies with the Linux
kernel coding style and improves readability.

Signed-off-by: Benjamin Sherman <benjamin@bensherman.io>
Link: https://lore.kernel.org/r/20190716045754.fivh5n44bybe2uce@valkyrie-mobile.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: Replace function rtl88eu_phy_rf_config()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:45 +0000 (12:47 +0530)]
staging: rtl8188eu: Replace function rtl88eu_phy_rf_config()

Remove function rtl88eu_phy_rf_config as all it does is call
rtl88e_phy_rf6052_config.
Rename rtl88e_phy_rf6052_config to rtl88eu_phy_rf_config and change its
type from static to non-static to maintain compatibility with call
sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-8-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: Replace function rtl88e_phy_rf6052_config()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:44 +0000 (12:47 +0530)]
staging: rtl8188eu: Replace function rtl88e_phy_rf6052_config()

Remove function rtl88e_phy_rf6052_config as all it does is call
rf6052_conf_para.
Rename rf6052_conf_para to rtl88e_phy_rf6052_config to maintain
compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-7-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: Replace function rtw_alloc_network()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:43 +0000 (12:47 +0530)]
staging: rtl8188eu: Replace function rtw_alloc_network()

Change external call site of _rtw_alloc_network to rtw_alloc_network.
Remove function rtw_alloc_network as all it does is call
_rtw_alloc_network.
Rename _rtw_alloc_network to rtw_alloc_network to maintain compatibility
with call sites. Keep its type as non-static (even though the old
rtw_alloc_network was static) as this functionality is used in other
files as well.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-6-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: Remove function rtw_modular64()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:42 +0000 (12:47 +0530)]
staging: rtl8188eu: Remove function rtw_modular64()

Remove function rtw_modular64 as all it does is call do_div.
Replace call to rtw_modular64 with call to do_div.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-5-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: Remove function rtw_os_indicate_scan_done()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:41 +0000 (12:47 +0530)]
staging: rtl8188eu: Remove function rtw_os_indicate_scan_done()

In function rtw_indicate_scan_done, replace call to
rtw_os_indicate_scan_done with call to indicate_wx_scan_complete_event
as all that rtw_os_indicate_scan_done does is call
indicate_wx_scan_complete_event.
Remove now-unused function rtw_os_indicate_scan_done.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-4-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: Replace function beacon_timing_control()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:40 +0000 (12:47 +0530)]
staging: rtl8188eu: Replace function beacon_timing_control()

Remove function beacon_timing_control as all it does is call
rtw_hal_bcn_related_reg_setting.
Rename rtw_hal_bcn_related_reg_setting to beacon_timing_control for
compatibility with call sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-3-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: core: Remove function enable_rate_adaptive()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:39 +0000 (12:47 +0530)]
staging: rtl8188eu: core: Remove function enable_rate_adaptive()

Remove function enable_rate_adaptive as it does nothing except call
Update_RA_Entry.
Modify call site of enable_rate_adaptive to call Update_RA_Entry
instead.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-2-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: core: Replace function Set_MSR()
Nishka Dasgupta [Fri, 12 Jul 2019 07:17:38 +0000 (12:47 +0530)]
staging: rtl8188eu: core: Replace function Set_MSR()

Change reference to Set_NETYPE0_MSR to Set_MSR.
Replace the contents of Set_MSR with the contents of Set_NETYPE0_MSR as
Set_MSR does nothing but call Set_NETYPE0_MSR.
Delete Set_NETYPE0_MSR.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Change return type of init_mlme_ext_priv
Hariprasad Kelam [Mon, 15 Jul 2019 17:46:18 +0000 (23:16 +0530)]
staging: rtl8723bs: core: Change return type of init_mlme_ext_priv

As init_mlme_ext_priv function always returns SUCCESS , We can change
return type from int to void.

Fixes below issue identified by coccicheck
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:464:5-8: Unneeded
variable: "res". Return "_SUCCESS" on line 492

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190715174618.GA8947@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: os_dep: Remove code valid only for 5GHz
Hariprasad Kelam [Sun, 14 Jul 2019 17:31:34 +0000 (23:01 +0530)]
staging: rtl8723bs: os_dep: Remove code valid only for 5GHz

As per TODO ,remove code valid only for 5 GHz(channel > 14).

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190714173134.GA7111@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Remove code valid only for 5GHz
Hariprasad Kelam [Sun, 14 Jul 2019 17:28:26 +0000 (22:58 +0530)]
staging: rtl8723bs: core: Remove code valid only for 5GHz

As per TODO ,remove code valid only for 5 GHz(channel > 14).

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190714172826.GA6950@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: Remove code valid only for 5GHz
Hariprasad Kelam [Sun, 14 Jul 2019 17:24:51 +0000 (22:54 +0530)]
staging: rtl8723bs: hal: Remove code valid only for 5GHz

As per TODO ,remove code valid only for 5 GHz(channel > 14).

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190714172451.GA6779@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_spi: Remove unnecessary null check before kfree
YueHaibing [Thu, 11 Jul 2019 14:07:26 +0000 (22:07 +0800)]
staging: kpc2000: kpc_spi: Remove unnecessary null check before kfree

A null check before a kfree is redundant, so remove it.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190711140726.46732-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: remove unused definitions from hal8188e_phy_reg.h
Michael Straube [Sun, 7 Jul 2019 16:56:49 +0000 (18:56 +0200)]
staging: rtl8188eu: remove unused definitions from hal8188e_phy_reg.h

Remove unused definitions from the file hal8188e_phy_reg.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20190707165649.1558-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/ethsw: Add comments to ETHSW_VLAN flags
Razvan Stefanescu [Fri, 5 Jul 2019 14:27:16 +0000 (17:27 +0300)]
staging: fsl-dpaa2/ethsw: Add comments to ETHSW_VLAN flags

Document each ETHSW_VLAN flag with the appropriate comment.

Signed-off-by: Razvan Stefanescu <razvan.stefanescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/1562336836-17119-7-git-send-email-ioana.ciornei@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/ethsw: Add ndo_get_phys_port_name
Razvan Stefanescu [Fri, 5 Jul 2019 14:27:14 +0000 (17:27 +0300)]
staging: fsl-dpaa2/ethsw: Add ndo_get_phys_port_name

Add the ndo_get_phys_port_name callback to the ethsw driver.

Signed-off-by: Razvan Stefanescu <razvan.stefanescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/1562336836-17119-5-git-send-email-ioana.ciornei@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/ethsw: Remove netdevice on port probing error
Razvan Stefanescu [Fri, 5 Jul 2019 14:27:13 +0000 (17:27 +0300)]
staging: fsl-dpaa2/ethsw: Remove netdevice on port probing error

If the ethsw_port_init() call failed, the netdevice remains registered in
the system.

Use labels to ensure that netdevice is unregistered and freed in this case.

Signed-off-by: Razvan Stefanescu <razvan.stefanescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/1562336836-17119-4-git-send-email-ioana.ciornei@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/ethsw: Add network interface statistics
Razvan Stefanescu [Fri, 5 Jul 2019 14:27:12 +0000 (17:27 +0300)]
staging: fsl-dpaa2/ethsw: Add network interface statistics

Allocate MC portal with atomic context for I/O and enable network interface
statistics for hardware counters.

Signed-off-by: Razvan Stefanescu <razvan.stefanescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/1562336836-17119-3-git-send-email-ioana.ciornei@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/ethsw: Fix setting port learning/flooding flags
Razvan Stefanescu [Fri, 5 Jul 2019 14:27:11 +0000 (17:27 +0300)]
staging: fsl-dpaa2/ethsw: Fix setting port learning/flooding flags

ethsw_set_learning()/ethsw_set_flood() use flags parameter as an
enable/disable (1/0) indicator. Previous usage sent incorrect values.

Signed-off-by: Razvan Stefanescu <razvan.stefanescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/1562336836-17119-2-git-send-email-ioana.ciornei@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wlan-ng: use "%*pE" for serial number
J. Bruce Fields [Wed, 10 Jul 2019 23:00:56 +0000 (19:00 -0400)]
staging: wlan-ng: use "%*pE" for serial number

Almost every user of "%*pE" in the kernel uses just bare "%*pE".  This
is the only user of "%pEhp".  I can't see why it's needed.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Link: https://lore.kernel.org/r/1562799656-13401-1-git-send-email-bfields@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: Replace function wilc_wlan_cfg_get_val()
Nishka Dasgupta [Fri, 12 Jul 2019 07:20:09 +0000 (12:50 +0530)]
staging: wilc1000: Replace function wilc_wlan_cfg_get_val()

Include wilc_wlan_cfg.h in wilc_netdev.c to enable it to call functions
in wilc_wlan_cfg.c.
Remove function wilc_wlan_cfg_get_val as all it does is call
wilc_wlan_cfg_get_wid_value in file wilc_wlan_cfg.c.
Rename function wilc_wlan_cfg_get_wid_value to wilc_wlan_cfg_get_val to
maintain compatibility with call sites (including in wilc_netdev.c).
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712072009.2550-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wlan-ng: Replace function hfa384x_dowmem()
Nishka Dasgupta [Fri, 12 Jul 2019 06:28:07 +0000 (11:58 +0530)]
staging: wlan-ng: Replace function hfa384x_dowmem()

Remove parameters mode, cmdcb, usercb, and usercb_data from
hfa384x_dowmem as these parameters are only assigned the same constant
values (DOWAIT, NULL, NULL, NULL respectively).
Modify hfa384x_dowmem to use these constants directly. Remove check for
value of mode (as it will always be DOWAIT).
Remove function hfa384x_dowmem_wait as it does nothing except call
hfa384x_dowmem with these extra arguments.
Modify call sites of hfa384x_dowmem_wait to call hfa384x_dowmem instead.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712062807.9361-10-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>