Commit Graph

781937 Commits

Author SHA1 Message Date
Jonathan Cameron 7a5f0b3a08 spi: Provide SPI_CS_WORD
This provides a SPI operation mode which changes chip select after every
 word, used by some devices such as ADCs and DACs.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlugGWgTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0OAqB/99Zk/yjUqw3q8mQ9TcDyurMrllpNYm
 n9KshwKOc1wyfHsbPMke+ytCJHmMpNDKbv80Dk5aTNBvbeNN9OZdcqonGfVfulEB
 hhZy6X4wN6QwX6HpIeWl52o4V4zLd0skeZOqMod/4RQKQvG7kCVVetKFfzMBxYpP
 4B+jVLg/L/lVsbNqXe53A59C0myg/lkCBFL9uWmiUaAScS/eeWmHX/Z+Guf3DTjo
 eR0ZoB55HeovL8AsTV0xAwjae+YM6LMElptXLF/+AlaFmW4WmuRGuU2tCXh+SaHU
 /VzwLgekzd1hplHc8tX1Nhdr4qJhI6tcpQOu+IelTqZ/Z/JlpIruaJVB
 =sMBd
 -----END PGP SIGNATURE-----

Merge tag 'spi-cs-word' into togreg

spi: Provide SPI_CS_WORD

This provides a SPI operation mode which changes chip select after every
word, used by some devices such as ADCs and DACs.
2018-09-22 10:02:45 +01:00
David Lechner cbaa62e009
spi: add software implementation for SPI_CS_WORD
This adds a default software implementation for the SPI_CS_WORD flag for
controllers that don't have such a feature.

The SPI_CS_WORD flag indicates that the CS line should be toggled
between each word sent, not just between each transfer. The
implementation works by using existing functions to split transfers into
one-word-sized transfers and sets the cs_change bit for each of the
new transfers.

Signed-off-by: David Lechner <david@lechnology.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 14:14:18 -07:00
David Lechner 0baf9eb255
spi: add new SPI_CS_WORD flag
This adds a new SPI mode flag, SPI_CS_WORD, that is used to indicate
that a SPI device requires the chip select to be toggled after each
word that is transferred.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 14:08:35 -07:00
Alexandru Ardelean c8d5b99696 staging:iio:ad7606: Remove incorrect kernel doc annotations
The ad7606_chip_info struct does not have the lock & name fields. Remove
the kernel documentation annotations for it.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-16 12:18:36 +01:00
Alexandru Ardelean 4ee033301c staging:iio:ad7606: fix voltage scales
Fixes commit 17be2a2905 ("staging: iio:
ad7606: replace range/range_available with corresponding scale").

The AD7606 devices don't have a 2.5V voltage range, they have 5V & 10V
voltage range, which is selectable via the `gpio_range` descriptor.

The scales also seem to have been miscomputed, because when they were
applied to the raw values, the results differ from the expected values.
After checking the ADC transfer function in the datasheet, these were
re-computed.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-16 12:18:20 +01:00
Thomas Petazzoni 6029b7ac29 MAINTAINERS: remove myself as staging FBTFT maintainer
Even though I did introduce the fbtft code in staging a while ago to
stop seeing this being developed out-of-tree, I don't intend to
maintain it, and I don't use it actively. So be honest and remove
myself from the MAINTAINERS file for this subsystem.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14 15:41:34 +02:00
Igor Stoppa 009e451c4f staging: octeon-hcd: remove unnecessary unlikely()
WARN_ON() already contains an unlikely(), so it's not necessary to
wrap it into another.

Signed-off-by: Igor Stoppa <igor.stoppa@huawei.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14 15:21:06 +02:00
zhong jiang faeeeea896 staging: remove unneeded static set .owner field in platform_driver
platform_driver_register will set the .owner field. So it is safe
to remove the redundant assignment.

The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14 10:45:51 +02:00
Colin Ian King b4a01d8fa3 staging: wilc1000: fix null checks on wilc
Currently the pointer wilc is being null checked several times
and yet not checked for the final workqueue flush and destroy
(which can lead to a null pointer dereference if wilc is null);
these missing null checks were overlooked in an earlier core
refactoring commit.

Clean up the code by checking wilc at the start and bailing out
early if it is null allowing the subsequent null checks to be
removed, this also fixes the potential null pointer deferences
on the workqueue flush and destroy calls.

Detected by CoverityScan, CID#1473305 ("Dereference after null check")

Fixes: b3ee105c33 ("staging: wilc1000: refactor code to move initilization in wilc_netdev_init()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14 10:45:51 +02:00
Greg Kroah-Hartman 4b55dce8b0 1st round of IIO new device support, features and cleanups in the 4.20 cycle.
There is a merge commit in here to pull in regmap support for repeatedly
 reading the same register (to read out FIFOs).  Used by the adxl372 driver.
 This will find uses elsewhere once we tidy up various drivers that are
 effectively doing this and relying on not enabling regcache.
 
 New device support
 * Analog devices ADXL372 accelerometer
   - new driver for this accelerometer including fifo and and interrupt support.
     Follow up patches enforce trigger validation, add sampling frequency
     control and filter bandwidth control.  A later series added i2c support
     to the existing SPI support.
 * ST lsm6dsx
   - rework and add support fo the LSM6DSO 6 axis mems sensor.
 * Linear LTC 1660 DAC
   - new driver supporting the LTC 1660 and LTC 1665 SPI DACs.
 * Microchip mcp3911 ADC.
   - new driver for this integrated analog front end and ADC.
 * Qualcomm SPMI PMIC5 adc driver
   - using the spmi framework, new driver and bindings for this ADC.
     Follow up patch adds some missing channels.
 
 Features
 * ad5758
   - support hard reset using a gpio (if provided).
 * mpu6050
   - Regulator support
 * qcom-spmi-adc5
   - Sanity check the channel numbers provided by DT to make sure the
     driver actually knows about them.
 * sc27xx
   - give raw data for channel 20 as it's used on all known boards for
     the headset which needs a custom converstion function.  If it turns
     out someone builds a board where this isn't true we will deal with it
     when it happens.
   - add ADC scale calibration.
 * tsl2772
   - support device tree binding to set the proximity led settings.
   - regulator supprot.
   - binding for apds9930 - trivial addition as register compatible with tsl2772.
 
 Cleanups / Minor fixes
 
 * adxl345
   - supress a static checker warning but explicitly checking if the id
     object is null.
 * bh1750
   - avoid CONFIG_PM_SLEEP checks.
   - SPDX.
 * bme680
   - spelling mistake
   - use clamp rather than open coding.
   - white space and other similar fixes.
   - rename MSK to MASK for clarifty and use GENMASK to specify them.
   - use the FIELD_GET macro rather than a very odd accessor of dividing by
     16 to get the shift.
   - rework to share handing for oversampling of the various channels in a
     unified way.
   - check explicitly for val2 in write_raw function to ensure it is 0.
   - drop some field defines that don't add anything.
 * dpot-adc
   - SPDX
 * envelope detector
   - SPDX
 * isl29501
   - fix an ancient compiler warning mostly because it results in much
     nicer code.
 * max30102
   - mark switch fall throughs.
 * max44000
   - drop an unused variable.
 * max512
   - avoid CONFIG_PM_SLEEP checks.
 * max5481
   - use of_device_get_match_data rather than open coding it.
 * max5821
   - avoid CONFIG_PM_SLEEP checks.
 * max9611
   - explicity cast an enum to an integer to make it totally clear that
     this is intended.
 * mcp4018
   - fix an inconsistent MODULE_LICENSE.
   - use of_device_get_match_data rather than open coding it.
 * mcp4531
   - use of_device_get_match_data rather than open coding it.
   - SPDX
 * mcp4725
   - avoid CONFIG_PM_SLEEP checks.
 * mcp4922
   - Fix error handling and prevent writing a negative to when setting the
     output voltage.
 * ms5611
   - drop deprecated compatible strings without manufacturer from being
     explicitly listed.  They are handled anyway.
   - SPDX
 * multiplexer
   - SPDX
 * qcom-vadc
   - fix inconsistent documentation for reg.
 * ti-dac5571
   - provide and of_match_table.
 
 * treewide
   - update Michael Hennerich's email address.
   - Use %pOFn rather than device_node.name.
 * documentation.
   - tidy up a wrong kernel version for the introduction of the
     position_relative ABI.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAluave0RHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0Fogr/A//bfXkfYPO2tPQOe+Ut/isyKvceDFs4faJ
 0ogmVxrH5hwFe96vfB0RWcYhovKXONrRtqreMCiVPMjKxg5o+F3Q+eSj0qhxhG77
 bDV5CnF1GXiBe/02WSEs9B3L4oxu6Z/PGq2sGrlTfTy8NZxJW6biER1aWeBbxmR6
 nPBb9SXH4vuqiiF8UOwRB2ETelx2jXXCNFxmUVQ0bzCYgAp/n7B2ZJu6OxWIhBGC
 NEPYofFajNATJEGgTQmwmKNv6xL4wVSpZXMLO1hzKPe8arARBqPGjIg14srl+nWs
 HsOdsl/GkeOcPsI7aUvQO0zC5nOgU9iXtQFZQLq8D1xMQP9LzfRuLhymy8dH8hg+
 uUfxkJf0OwhqEW+6GJ0g4A2xaDHyM7JFQAV1/XCNS93qjpcgC7rcLbnSDy9u6SC/
 j3g3EFUXVYqOuFXbr+1TLrg/oJhnOkXp3Wbm/Di0zXJNYOtzQ9zSLp55HZLxvOOl
 zzLWCSkse9EAwHzVnl4BAd03Zw3Ewh9aAJlXQ7JKGtQSXo+PpFyIiyn8woQpzGV8
 OePhhmooOYVxI2Aua0UKhwa6lPeZT71zjpJyFCTFJqRwU3I/8HEDH5g+9dX6Vk6h
 CLF/fCLCkRa1ccDzFQbHai91xLflaYUsXdjOnQymJ5CYToni/IyPukrZ05b2IdvO
 XnMIaoVrAUU=
 =+9gG
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

1st round of IIO new device support, features and cleanups in the 4.20 cycle.

There is a merge commit in here to pull in regmap support for repeatedly
reading the same register (to read out FIFOs).  Used by the adxl372 driver.
This will find uses elsewhere once we tidy up various drivers that are
effectively doing this and relying on not enabling regcache.

New device support
* Analog devices ADXL372 accelerometer
  - new driver for this accelerometer including fifo and and interrupt support.
    Follow up patches enforce trigger validation, add sampling frequency
    control and filter bandwidth control.  A later series added i2c support
    to the existing SPI support.
* ST lsm6dsx
  - rework and add support fo the LSM6DSO 6 axis mems sensor.
* Linear LTC 1660 DAC
  - new driver supporting the LTC 1660 and LTC 1665 SPI DACs.
* Microchip mcp3911 ADC.
  - new driver for this integrated analog front end and ADC.
* Qualcomm SPMI PMIC5 adc driver
  - using the spmi framework, new driver and bindings for this ADC.
    Follow up patch adds some missing channels.

Features
* ad5758
  - support hard reset using a gpio (if provided).
* mpu6050
  - Regulator support
* qcom-spmi-adc5
  - Sanity check the channel numbers provided by DT to make sure the
    driver actually knows about them.
* sc27xx
  - give raw data for channel 20 as it's used on all known boards for
    the headset which needs a custom converstion function.  If it turns
    out someone builds a board where this isn't true we will deal with it
    when it happens.
  - add ADC scale calibration.
* tsl2772
  - support device tree binding to set the proximity led settings.
  - regulator supprot.
  - binding for apds9930 - trivial addition as register compatible with tsl2772.

Cleanups / Minor fixes

* adxl345
  - supress a static checker warning but explicitly checking if the id
    object is null.
* bh1750
  - avoid CONFIG_PM_SLEEP checks.
  - SPDX.
* bme680
  - spelling mistake
  - use clamp rather than open coding.
  - white space and other similar fixes.
  - rename MSK to MASK for clarifty and use GENMASK to specify them.
  - use the FIELD_GET macro rather than a very odd accessor of dividing by
    16 to get the shift.
  - rework to share handing for oversampling of the various channels in a
    unified way.
  - check explicitly for val2 in write_raw function to ensure it is 0.
  - drop some field defines that don't add anything.
* dpot-adc
  - SPDX
* envelope detector
  - SPDX
* isl29501
  - fix an ancient compiler warning mostly because it results in much
    nicer code.
* max30102
  - mark switch fall throughs.
* max44000
  - drop an unused variable.
* max512
  - avoid CONFIG_PM_SLEEP checks.
* max5481
  - use of_device_get_match_data rather than open coding it.
* max5821
  - avoid CONFIG_PM_SLEEP checks.
* max9611
  - explicity cast an enum to an integer to make it totally clear that
    this is intended.
* mcp4018
  - fix an inconsistent MODULE_LICENSE.
  - use of_device_get_match_data rather than open coding it.
* mcp4531
  - use of_device_get_match_data rather than open coding it.
  - SPDX
* mcp4725
  - avoid CONFIG_PM_SLEEP checks.
* mcp4922
  - Fix error handling and prevent writing a negative to when setting the
    output voltage.
* ms5611
  - drop deprecated compatible strings without manufacturer from being
    explicitly listed.  They are handled anyway.
  - SPDX
* multiplexer
  - SPDX
* qcom-vadc
  - fix inconsistent documentation for reg.
* ti-dac5571
  - provide and of_match_table.

* treewide
  - update Michael Hennerich's email address.
  - Use %pOFn rather than device_node.name.
* documentation.
  - tidy up a wrong kernel version for the introduction of the
    position_relative ABI.
2018-09-14 10:38:48 +02:00
Chengguang Xu 064ee3c0da staging: erofs: surround fault_injection ralted option parsing using CONFIG_EROFS_FAULT_INJECTION
It's a little bit strange when fault_injection related
option fail with -EINVAL which was already disabled
from config, so surround all fault_injection related option
parsing code using CONFIG_EROFS_FAULT_INJECTION. Meanwhile,
slightly change warning message to keep consistency with
option POSIX_ACL and FS_XATTR.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14 09:05:03 +02:00
Thomas Weißschuh 7dd68b147d staging: erofs: use explicit unsigned int type
Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
detected by checkpatch.pl.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14 09:05:03 +02:00
Michael Straube 645923e441 staging: rtl8188eu: change array type to u8
The the last two parameters of write_cam() have type u8.
Change the type of the passed arrays from unsigned char to u8.
Clears a line over 80 characters checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-11 18:37:57 +02:00
Michael Straube c1a0bb1779 staging: rtl8188eu: fix lines over 80 characters in rtw_led.c
Wrap lines over 80 characters where appropriate to
clear checkpatch warnings.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-11 18:35:16 +02:00
Michael Straube ccfe34c01c staging: rtl8188eu: remove unnecessary parentheses in rtw_led.c
Remove unnecessary parentheses from conditionals.
Also clears 'Alignment should match open parenthesis'
checkpatch issue.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-11 18:35:16 +02:00
Michael Straube 00585495c4 staging: rtl8188eu: refactor SwLedControlMode1()
Refactor switch cases in SwLedControlMode1() to reduce
indentation level. Also clears line over 80 characters
checkpatch warnings.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-11 18:35:15 +02:00
Ajay Singh 7aaaabd50d staging: wilc1000: remove handle_hif_exit_work() function
Cleanup to remove handle_hif_exit_work(), as after code refactoring its
not required anymore.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh a53b0b1392 staging: wilc1000: refactor wilc_netdev_init() to handle memory free in error path
Refactor the wilc_netdev_init() to cleanup the memory for error
scenario and remove unnecessary 'dev' pointer check.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh b3ee105c33 staging: wilc1000: refactor code to move initilization in wilc_netdev_init()
Refactor code to move the initialization of wilc related parameters in
wilc_netdev_init() and move their deinitialization in
wilc_netdev_cleanup(). For 'hif_workqueue' creation 'clients_count' check
is not required as the single instance is maintained.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh 28ab936ed1 staging: wilc1000: remove unnecessary static variable 'p2p_listen_state'
Remove the use of unnecessary static variable 'p2p_listen_state'.
Already 'p2p_listen_state' is present in 'wilc_priv' struct. So making
use of that variable as its getting set in channel ready and
remain on channel expired callback.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh 804146b4bd staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' struct
Move static variable 'wilc_connecting' as part of 'wilc_vif' private
struct. Remove "wilc_" prefix from name as its already part of wilc_vif
struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh 3124a1f7bf staging: wilc1000: move 'chip_ps_state' static variable as part of 'wilc' struct
Move the static variable as part of 'wilc' priv struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh abff8e3353 staging: wilc1000: remove unused code to set and get IP address
Cleanup code to remove the variables related to setting and getting IP
address as this case was not handled from firmware side.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh f31e5584dc staging: wilc1000: use short names to fix over 80 issue in tcp_process()
Use short variable names to avoid line over 80 chars checkpatch warning
in tcp_process().

struct pending_acks_info     --> struct pending_ack
int tcp_pending_ack_idx      --> int ack_idx
u32 pending_ack              --> u32 pending_ack_idx

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh a3178da452 staging: wilc1000: avoid line over 80 chars in wilc_wlan_txq_filter_dup_tcp_ack()
Cleanup patch to avoid line over 80 chars checkpatch issue introduced in
previous code refactor commit.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh 95e05b4bf2 staging: wilc1000: move tcp_ack_filter algo related variables to 'wilc_vif' struct
Avoid use of static variables and move them as part of wilc_vif struct.
Move all the parameters related to tcp_ack_filter algo to wilc_vif
struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:39 +02:00
Ajay Singh 72f36b5b81 staging: wilc1000: use lowercase for get_BSSID() and HIL variable
Cleanup patch to use lowercase name for get_BSSID() and HIL variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:39 +02:00
Ajay Singh 7ec6f7f275 staging: wilc1000: refactor tcp_process() to avoid extra leading tabs
Refactor tcp_process() to avoid unnecessary leading tabs in the
function.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:39 +02:00
Ajay Singh 83a953e2a7 staging: wilc1000: move 'rcv_assoc_resp' as part of hif_drv
Avoid use of static variable and move 'rcv_assoc_resp' as part of
'hif_drv' struct. Rename from 'rcv_assoc_resp' to 'assoc_resp'.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:39 +02:00
Ajay Singh 8b89ba7611 staging: wilc1000: rename 'dummy_statistics' variable to 'periodic_stat'
Cleanup patch to use appropriate variable name to fetch the periodic
statistics.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:39 +02:00
Ajay Singh 5fefe58f7f staging: wilc1000: move 'periodic_rssi' as part of 'wilc_vif' struct
Refactor code to move 'periodic_rssi' as part of wilc_vif struct. Move
'dummy_statistics' from 'wilc' struct to 'wilc_vif' to maintain for
each interface separately.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:39 +02:00
Ajay Singh 87de37fe2a staging: wilc1000: move hif_workqueue static variables to 'wilc' structure
Avoid use of static variable hif_workqueue and move it inside 'wilc'
structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh e624c58cf8 staging: wilc1000: refactor code to avoid use of wilc_set_multicast_list global
Refactor the code to avoid use of 'wilc_set_multicast_list' global
variable. Allocate the memory required to keep the multicast mac address
and pass it to the worker thread.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 0b68334d48 staging: wilc1000: move static variable clients_count to 'wilc' structure
Avoid use of static variable 'clients_count' and move it part of 'wilc'
structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 6bccf8fc6c staging: wilc1000: avoid use of extra 'if' condition in wilc_init()
Cleanup patch to avoid the avoid extra 'if' condition and clubbed the
same condition in single 'if' block.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 7814fb6ca8 staging: wilc1000: remove unused variable 'op_ifcs'
After code refactor in previous commit now 'op_ifcs' is not require any
more, so remove it.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh aa6ed22a03 staging: wilc1000: move during_ip_timer & wilc_optaining_ip to 'wilc_vif' struct
Move global variable 'wilc_during_ip_timer' and 'wilc_optaining_ip' to
'wilc_vif' structure.

Rename these variables like below

wilc_during_ip_timer -> during_ip_timer
wilc_optaining_ip -> obtaining_ip.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 0e866cfb0d staging: wilc1000: moved last_scanned_shadow & last_scanned_cnt to wilc_priv struct
Avoid use of static variables and moved the varibles as part of private
data. last_scanned_shadow & last_scanned_cnt variable is moved to
'wilc_priv' to maintain for each interface. After moving static
variable, clear_shadow_scan() doesn't require check 'op_ifcs'
count as now for each interface the againg timer is initiated.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 009324daf6 staging: wilc1000: remove unnecessary NULL check in clear_shadow_scan()
Cleanup patch to remove the unnecessary NULL check before freeing up ies
information in clear_shadow_scan().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 19707ca295 staging: wilc1000: fix to use correct index to free scanned info in clear_shadow_scan()
Fixes to use correct index to free the allocated memory for ies
information. The check was done using 'last_scanned_cnt' index and its
not correct, so use the correct index ('i') to check for before freeing
the allocated memory.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 1803da60f7 staging: wilc1000: move 'aging_timer' static variable to wilc_priv struct
Moved 'aging_timer' to wilc_priv struct instead of having it as static
variable.
As 'aging_timer' is maintained for each interfaces so 'op_ifcs' check is
not required before the timer_setup() and del_timer_sync() call.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:37 +02:00
Ajay Singh 4cf1339953 staging: wilc1000: move 'wilc_enable_ps' global variable into 'wilc' struct
Instead of having 'wilc_enable_ps' as global variable moved it to 'wilc'
structure. Rename 'wilc_enable_ps' to 'enable_ps' as its already part of
'wilc' structure

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:37 +02:00
Colin Ian King d5c69c9679 staging: rtl8723bs: check for i out of range before accessing szLine[i]
Currently szLine[i] is being accessed before the index i is being
ranged checked.  Fix this by checking the range first.  Also, evaluate
the length of the string szLine just once rather than multiple times and
move the loop variable i to an inner scope and make it an int.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:12:42 +02:00
André Lehmann ec3d17acd6 Staging: rtl8712: Add space between else and opening brace
issue found by checkpatch

Signed-off-by: André Lehmann <lenneman@web.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:12:42 +02:00
Sidong Yang dacdf6a659 staging: rtl8192u: ieee80221: Add missing space
Fix checkpatch.pl errors that missing space before ','.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:12:41 +02:00
John Whitmore 001dd86bb1 staging:rtl8192u: Remove typedef from enum opt_rst_type_e - Style
Remove the typedef directive from enumerated type opt_rst_type_e,
this change clears the checkpatch issue with defining new types in
the code.

This is a coding style change which should not impact runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:12:16 +02:00
John Whitmore 2c226ff18c staging:rtl8192u: Remove typedef from firmware_init_step_e - Style
Remove the typedef directive from enumerated type firmware_init_step_e
this clears the checkpatch issue with adding new types to the code.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:12:16 +02:00
John Whitmore 6b525447d1 staging:rtl8192u: Refactor GET_COMMAND_PACKET_FRAG_THRESHOLD - Style
The MACRO GET_COMMAND_PACKET_FRAG_THRESHOLD causes a number of
checkpatch issues so has been refactored to use braces around the
parameter 'v' to avoid precedence issues, and to add spaces around
operators.

These changes are coding style changes which should have no impact
on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:12:16 +02:00
John Whitmore 6b32882b8c staging:rtl8192u: Remove unused RTL8190_CPU_START_OFFSET - Style
The defined constant RTL8190_CPU_START_OFFSET is not used in the code
so has been removed. This is a coding style change which should have
no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:12:16 +02:00
John Whitmore 639bcec974 staging:rtl8192u: Fix space characters - Style
Fix the spacing issues, remove space after cast operation, and replace
spaces at start of line with tab.

These changes are purely coding style changes to resolve checkpatch
issues. There should be no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:11:26 +02:00