platform/kernel/linux-starfive.git
3 years agostaging: hi6421-spmi-pmic: use devm_request_threaded_irq()
Mauro Carvalho Chehab [Fri, 25 Jun 2021 07:45:57 +0000 (09:45 +0200)]
staging: hi6421-spmi-pmic: use devm_request_threaded_irq()

Use devm_request_threaded_irq() in order to simplify the
driver.

Suggested-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/b47827c3466eeef3a7de6ac56b1fe93b5ff84e30.1624606660.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hisilicon,hi6421-spmi-pmic.yaml: cleanup descriptions
Mauro Carvalho Chehab [Fri, 25 Jun 2021 07:45:55 +0000 (09:45 +0200)]
staging: hisilicon,hi6421-spmi-pmic.yaml: cleanup descriptions

Minor cleanups at the schema:
 - There's no need to describe interrupt-controller;
 - gpios need a description.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/9f421e254061a42b7b598bd96b12f05460c175c9.1624606660.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agospmi: hisi-spmi-controller: move driver from staging
Mauro Carvalho Chehab [Fri, 25 Jun 2021 07:45:54 +0000 (09:45 +0200)]
spmi: hisi-spmi-controller: move driver from staging

The Hisilicon 6421v600 SPMI driver is ready for mainstream.

So, move it from staging.

Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/35b9f9169889c1f4d51eff8bf2035450c9e02576.1624606660.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agophy: phy-hi3670-usb3: move driver from staging into phy
Mauro Carvalho Chehab [Fri, 25 Jun 2021 07:45:53 +0000 (09:45 +0200)]
phy: phy-hi3670-usb3: move driver from staging into phy

The phy USB3 driver for Hisilicon 970 (hi3670) is ready
for mainstream. Mode it from staging into the main driver's
phy/ directory.

Acked-by: Rob Herring <robh@kernel.org>
Acked-By: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/dcf66a01aaeaab93cda52f9a283ecbdf9fa71bb8.1624606660.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove include/rtw_debug.h header
Phillip Potter [Fri, 25 Jun 2021 00:07:56 +0000 (01:07 +0100)]
staging: rtl8188eu: remove include/rtw_debug.h header

Remove include/rtw_debug.h header file, as this isn't used and gets
rid of the various other definitions we don't need. Also move the
DRIVERVERSION constant value directly to os_dep/os_intfs.c as it is
only used there anyway. This results in removal of more unnecessary code.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-24-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove GlobalDebugLevel variable
Phillip Potter [Fri, 25 Jun 2021 00:07:55 +0000 (01:07 +0100)]
staging: rtl8188eu: remove GlobalDebugLevel variable

Remove GlobalDebugLevel variable and all of its uses, as it is now
no longer used anywhere in this driver.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-23-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove DRIVER_PREFIX preprocessor definition
Phillip Potter [Fri, 25 Jun 2021 00:07:54 +0000 (01:07 +0100)]
staging: rtl8188eu: remove DRIVER_PREFIX preprocessor definition

Remove DRIVER_PREFIX preprocessor definition, as well as the short
block of dumping code that uses it in core/rtw_recv.c - this code
is unneeded, as normal debugging facilities can tell us what driver
this is simply by pathname etc.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-22-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove RT_TRACE macro
Phillip Potter [Fri, 25 Jun 2021 00:07:53 +0000 (01:07 +0100)]
staging: rtl8188eu: remove RT_TRACE macro

Remove RT_TRACE macro from include/rtw_debug.h, as it now has no
callers, and does not follow best practices and kernel coding
conventions.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-21-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from hal/rtl8188eu_recv.c
Phillip Potter [Fri, 25 Jun 2021 00:07:52 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from hal/rtl8188eu_recv.c

Remove all RT_TRACE calls from hal/rtl8188eu_recv.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-20-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from hal/hal_intf.c
Phillip Potter [Fri, 25 Jun 2021 00:07:51 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from hal/hal_intf.c

Remove all RT_TRACE calls from hal/hal_intf.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-19-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from hal/rtl8188eu_xmit.c
Phillip Potter [Fri, 25 Jun 2021 00:07:50 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from hal/rtl8188eu_xmit.c

Remove all RT_TRACE calls from hal/rtl8188eu_xmit.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-18-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_xmit.c
Phillip Potter [Fri, 25 Jun 2021 00:07:49 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_xmit.c

Remove all RT_TRACE calls from core/rtw_xmit.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-17-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_pwrctrl.c
Phillip Potter [Fri, 25 Jun 2021 00:07:48 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_pwrctrl.c

Remove all RT_TRACE calls from core/rtw_pwrctrl.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-16-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_recv.c
Phillip Potter [Fri, 25 Jun 2021 00:07:47 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_recv.c

Remove all RT_TRACE calls from core/rtw_recv.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-15-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_ioctl_set.c
Phillip Potter [Fri, 25 Jun 2021 00:07:46 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_ioctl_set.c

Remove all RT_TRACE calls from core/rtw_ioctl_set.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-14-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_ieee80211.c
Phillip Potter [Fri, 25 Jun 2021 00:07:45 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_ieee80211.c

Remove all RT_TRACE calls from core/rtw_ieee80211.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-13-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_wlan_util.c
Phillip Potter [Fri, 25 Jun 2021 00:07:44 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_wlan_util.c

Remove all RT_TRACE calls from core/rtw_wlan_util.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-12-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_led.c
Phillip Potter [Fri, 25 Jun 2021 00:07:43 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_led.c

Remove all RT_TRACE calls from core/rtw_led.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-11-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_mlme.c
Phillip Potter [Fri, 25 Jun 2021 00:07:42 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_mlme.c

Remove all RT_TRACE calls from core/rtw_mlme.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Also remove rtw_atimdone_event_callback and rtw_cpwm_event_callback
functions and their associated header declarations/usages, as all
they do is call RT_TRACE and nothing else.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-10-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_mlme_ext.c
Phillip Potter [Fri, 25 Jun 2021 00:07:41 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_mlme_ext.c

Remove all RT_TRACE calls from core/rtw_mlme_ext.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-9-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_sta_mgt.c
Phillip Potter [Fri, 25 Jun 2021 00:07:40 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_sta_mgt.c

Remove all RT_TRACE calls from core/rtw_sta_mgt.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from core/rtw_security.c
Phillip Potter [Fri, 25 Jun 2021 00:07:39 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from core/rtw_security.c

Remove all RT_TRACE calls from core/rtw_security.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from os_dep/recv_linux.c
Phillip Potter [Fri, 25 Jun 2021 00:07:38 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from os_dep/recv_linux.c

Remove all RT_TRACE calls from os_dep/recv_linux.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from os_dep/mlme_linux.c
Phillip Potter [Fri, 25 Jun 2021 00:07:37 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from os_dep/mlme_linux.c

Remove all RT_TRACE calls from os_dep/mlme_linux.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from os_dep/os_intfs.c
Phillip Potter [Fri, 25 Jun 2021 00:07:36 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from os_dep/os_intfs.c

Remove all RT_TRACE calls from os_dep/os_intfs.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from os_dep/xmit_linux.c
Phillip Potter [Fri, 25 Jun 2021 00:07:35 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from os_dep/xmit_linux.c

Remove all RT_TRACE calls from os_dep/xmit_linux.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all RT_TRACE calls from os_dep/ioctl_linux.c
Phillip Potter [Fri, 25 Jun 2021 00:07:34 +0000 (01:07 +0100)]
staging: rtl8188eu: remove all RT_TRACE calls from os_dep/ioctl_linux.c

Remove all RT_TRACE calls from os_dep/ioctl_linux.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625000756.6313-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hisi-spmi-controller: rename spmi-channel property
Mauro Carvalho Chehab [Thu, 24 Jun 2021 14:01:31 +0000 (16:01 +0200)]
staging: hisi-spmi-controller: rename spmi-channel property

The spmi-channel is not used on other drivers. So, rename it,
in order to document that this is specific to those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/ed45fc5d84d7b531343ee5d3466ebfac26217da0.1624542940.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: phy-hi3670-usb3: do a some minor cleanups
Mauro Carvalho Chehab [Thu, 24 Jun 2021 14:01:30 +0000 (16:01 +0200)]
staging: phy-hi3670-usb3: do a some minor cleanups

Before moving this driver out of staging:

1. group some integers altogether;

2. Use:

return some_function()

instead of:

ret = some_function();
return ret;

This is just a cleanup. No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/55db419e42fd3af72494acbe0ea0f0d1de8906ac.1624542940.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: convert function to static
Fabio Aiuto [Wed, 23 Jun 2021 13:01:03 +0000 (15:01 +0200)]
staging: rtl8723bs: convert function to static

function chk_sta_is_alive() is used only inside core/rtw_ap.c
so remove the prototype and convert it to static.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210623130103.7727-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove item from TODO list
Fabio Aiuto [Tue, 22 Jun 2021 13:10:01 +0000 (15:10 +0200)]
staging: rtl8723bs: remove item from TODO list

remove item related to 5Ghz code deletion from
driver's TODO list.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/842b5ce0623be738d611d883433a8bf2aa895e90.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix check allowing 5Ghz settings
Fabio Aiuto [Tue, 22 Jun 2021 13:10:00 +0000 (15:10 +0200)]
staging: rtl8723bs: fix check allowing 5Ghz settings

fix check allowing 5Ghz settings, only disabled and
2.4Ghz enabled states are allowed. Fix comment
accordingly.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/df7d0ecc02ac7a27e568768523dd7b3f34acd551.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove obsolete 5Ghz comments
Fabio Aiuto [Tue, 22 Jun 2021 13:09:59 +0000 (15:09 +0200)]
staging: rtl8723bs: remove obsolete 5Ghz comments

remove obsolete 5Ghz comments.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/608f0b08ffae821d695cb2eadcffbd592912c906.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix macro value for 2.4Ghz only device
Fabio Aiuto [Tue, 22 Jun 2021 13:09:58 +0000 (15:09 +0200)]
staging: rtl8723bs: fix macro value for 2.4Ghz only device

fix IQK_Matrix_Settings_NUM macro value to 14 which is
the max channel number value allowed in a 2.4Ghz device.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0b4a876929949248aa18cb919da3583c65e4ee4e.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused ODM_CMNINFO_BOARD_TYPE enum item
Fabio Aiuto [Tue, 22 Jun 2021 13:09:57 +0000 (15:09 +0200)]
staging: rtl8723bs: remove unused ODM_CMNINFO_BOARD_TYPE enum item

remove ODM_CMNINFO_BOARD_TYPE enum item, fix comments
accordingly (given that 5GHz code isn't supported).

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e3adfc218779c9c1ea904e806f77fc5007be180f.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove VHT dead code
Fabio Aiuto [Tue, 22 Jun 2021 13:09:56 +0000 (15:09 +0200)]
staging: rtl8723bs: remove VHT dead code

remove VHT dead code, as the device doesn't support
VHT (which is a 802.11ac capability).

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2ca4be24e401bd862a96e2641a9b0377be36a25d.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove 5Ghz code related to RF power calibration
Fabio Aiuto [Tue, 22 Jun 2021 13:09:55 +0000 (15:09 +0200)]
staging: rtl8723bs: remove 5Ghz code related to RF power calibration

remove 5Ghz code related to RF calibration. Remove
table arrays, variables and macros related to RF power
tracking.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/f2096f71ae80f0cb7805a0e48536babc9809a3de.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove some unused 5Ghz macro definitions
Fabio Aiuto [Tue, 22 Jun 2021 13:09:54 +0000 (15:09 +0200)]
staging: rtl8723bs: remove some unused 5Ghz macro definitions

remove some unused 5Ghz macro definitions. Fix
comments accordingly.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8d2933555170e5f206b9198a203e8a31ee2b7702.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove 5Ghz code related to channel plan definition
Fabio Aiuto [Tue, 22 Jun 2021 13:09:53 +0000 (15:09 +0200)]
staging: rtl8723bs: remove 5Ghz code related to channel plan definition

remove 5Ghz code related to channel plan definition.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/17a707952cec951893748d2cb59d02a294cdd1be.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: beautify prototypes in include/hal_com_phycfg.h
Fabio Aiuto [Tue, 22 Jun 2021 13:09:52 +0000 (15:09 +0200)]
staging: rtl8723bs: beautify prototypes in include/hal_com_phycfg.h

beautify function prototypes in incldue/hal_com_phycfg.h
in order to ease grep searches.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8f6796cbbe726dd912fababe94b3dd1d8dcabbb7.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove all branchings between 2.4Ghz and 5Ghz band types
Fabio Aiuto [Tue, 22 Jun 2021 13:09:51 +0000 (15:09 +0200)]
staging: rtl8723bs: remove all branchings between 2.4Ghz and 5Ghz band types

remove all code branchings tied to dual band support. The device
works only on 2.4Ghz band so there's no need to check which
band we are on. Removed all code branches that would be valid
only for 5Ghz for it's dead code. Removed enums, table fields
indexing by band type, function arguments passing current
band type and all other thing related to telling us
which band we are on.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/72bb27f6a7b3be607f93f5b406d863dd08376986.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove struct rt_channel_plan_5g
Fabio Aiuto [Tue, 22 Jun 2021 13:09:50 +0000 (15:09 +0200)]
staging: rtl8723bs: remove struct rt_channel_plan_5g

remove struct rt_channel_plan_5g, for rtl8723bs works
only on 2.4Ghz band.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c9780328291ef84a8b0874e34da881d5e3885ddc.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove 5Ghz field in struct registry_priv
Fabio Aiuto [Tue, 22 Jun 2021 13:09:49 +0000 (15:09 +0200)]
staging: rtl8723bs: remove 5Ghz field in struct registry_priv

remove unused 5Ghz field in struct registry_priv.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/3a58fae5330a321dd570d1a7931a5b17bb3996a8.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: rename enum items related to channel bonding
Fabio Aiuto [Tue, 22 Jun 2021 13:09:48 +0000 (15:09 +0200)]
staging: rtl8723bs: rename enum items related to channel bonding

since rtl8723bs card allows only 20Mhz and 40Mhz channels,
rename enum items related to channel bonding accordingly to
the only composite channel bandwidth allowed in 2.4Ghz
(i.e. 40Mhz) in a HT context (since VHT isn't supported)

Example:

VHT_DATA_SC_20_LOWER_OF_80MHZ ->
HT_DATA_SC_LOWER_OF_40MHZ

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a4172419996bdcaf96f0d9b5438b3b2372ff69b7.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused enum items related to channel bonding
Fabio Aiuto [Tue, 22 Jun 2021 13:09:47 +0000 (15:09 +0200)]
staging: rtl8723bs: remove unused enum items related to channel bonding

remove unused enum items related to channel bonding.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/beb6760c04116b4720edf7257149828653bbda26.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove code related to unsupported channel bandwidth
Fabio Aiuto [Tue, 22 Jun 2021 13:09:46 +0000 (15:09 +0200)]
staging: rtl8723bs: remove code related to unsupported channel bandwidth

remove all code related to unsupported channel
bandwidth (i.e. 80, 80+80, 160 Mhz). rtl8723bs NIC
works only on 20 and 40 Mhz channels.

Module parameter rtw_bw_mode can only have two
values: 0 and 1 (20 Mhz and 40Mhz). So modify
the default value setting to zero the 5Ghz nibble.

Comments modified accordingly.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/7b2ee7cc0abfd8744ed5ff4a654fb333fee77ec7.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove all 5Ghz network types
Fabio Aiuto [Tue, 22 Jun 2021 13:09:45 +0000 (15:09 +0200)]
staging: rtl8723bs: remove all 5Ghz network types

remove all 5Ghz network types. rtl8723bs works on
802.11bgn standards and on 2.4Ghz band.

So remove all code related to 802.11a and 802.11ac
standards, which the device doesn't support.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/7e4644a71d0ba2819370171b3dc78bfc755f6313.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove MSG_88E macro from include/rtw_debug.h
Phillip Potter [Wed, 23 Jun 2021 23:49:02 +0000 (00:49 +0100)]
staging: rtl8188eu: remove MSG_88E macro from include/rtw_debug.h

Remove definition of MSG_88E macro from include/rtw_debug.h, as it
no longer has any callers and does not follow kernel coding conventions.
Removing this macro leaves only RT_TRACE and associated definitions.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-10-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove MSG_88E call from hal/odm.c
Phillip Potter [Wed, 23 Jun 2021 23:49:00 +0000 (00:49 +0100)]
staging: rtl8188eu: remove MSG_88E call from hal/odm.c

Remove MSG_88E call from hal/odm.c as this macro is unnecessary,
and this call is dubious in terms of necessity. Removing all calls
will ultimately allow the removal of the macro itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h
Phillip Potter [Wed, 23 Jun 2021 23:48:59 +0000 (00:48 +0100)]
staging: rtl8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h

Remove definition of DBG_88E_LEVEL macro from include/rtw_debug.h, as it
no longer has any callers and does not follow kernel coding conventions.
Removing all such macros will ultimately allow the removal of this file.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_xmit.c
Phillip Potter [Wed, 23 Jun 2021 23:48:58 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_xmit.c

Remove all DBG_88E_LEVEL calls from core/rtw_xmit.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_pwrctrl.c
Phillip Potter [Wed, 23 Jun 2021 23:48:57 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_pwrctrl.c

Remove all DBG_88E_LEVEL calls from core/rtw_pwrctrl.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_ioctl_set.c
Phillip Potter [Wed, 23 Jun 2021 23:48:56 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_ioctl_set.c

Remove all DBG_88E_LEVEL calls from core/rtw_ioctl_set.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_mlmw_ext.c
Phillip Potter [Wed, 23 Jun 2021 23:48:55 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_mlmw_ext.c

Remove all DBG_88E_LEVEL calls from core/rtw_mlmw_ext.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove all DBG_88E_LEVEL calls from os_dep/ioctl_linux.c
Phillip Potter [Wed, 23 Jun 2021 23:48:54 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from os_dep/ioctl_linux.c

Remove all DBG_88E_LEVEL calls from os_dep/ioctl_linux.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210623234902.7411-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove more unused defines
Martin Kaiser [Sun, 20 Jun 2021 17:53:01 +0000 (19:53 +0200)]
staging: rtl8188eu: remove more unused defines

Remove some defines for register addresses and bits which obviously
refer to chipsets other than rtl8188eu.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove sdio defines
Martin Kaiser [Sun, 20 Jun 2021 17:53:00 +0000 (19:53 +0200)]
staging: rtl8188eu: remove sdio defines

Remove sdio defines which are not used by this driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: make efuse_ReadEFuse static
Martin Kaiser [Sun, 20 Jun 2021 17:52:59 +0000 (19:52 +0200)]
staging: rtl8188eu: make efuse_ReadEFuse static

The function is used only inside rtw_efuse.c.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove RT_TRACE prints from pwrseqcmd.c
Martin Kaiser [Sun, 20 Jun 2021 17:52:58 +0000 (19:52 +0200)]
staging: rtl8188eu: remove RT_TRACE prints from pwrseqcmd.c

Eventually, all driver-specific debug prints should be removed.
Take another step in that direction.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: simplify rtl88eu_mon_init
Martin Kaiser [Sun, 20 Jun 2021 17:52:57 +0000 (19:52 +0200)]
staging: rtl8188eu: simplify rtl88eu_mon_init

The code looks a bit nicer without goto.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove HAL_INIT_PROFILE_TAG
Martin Kaiser [Sun, 20 Jun 2021 17:52:56 +0000 (19:52 +0200)]
staging: rtl8188eu: remove HAL_INIT_PROFILE_TAG

Remove HAL_INIT_PROFILE_TAG, which is an empty loop already.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove RT_TRACE and MSG_88E prints from usb_halinit.c
Martin Kaiser [Sun, 20 Jun 2021 17:52:55 +0000 (19:52 +0200)]
staging: rtl8188eu: remove RT_TRACE and MSG_88E prints from usb_halinit.c

Eventually, all driver-specific debug prints should be removed.
Take another step in that direction.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unnecessary if clause
Martin Kaiser [Sun, 20 Jun 2021 17:52:54 +0000 (19:52 +0200)]
staging: rtl8188eu: remove unnecessary if clause

if and else do the same thing.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove efuse type
Martin Kaiser [Sun, 20 Jun 2021 17:52:53 +0000 (19:52 +0200)]
staging: rtl8188eu: remove efuse type

A number of efuse-related functions have an "efuse type" parameter.
This type is not used and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove a couple of unused defines
Martin Kaiser [Sun, 20 Jun 2021 17:52:52 +0000 (19:52 +0200)]
staging: rtl8188eu: remove a couple of unused defines

Remove some defines which are not used by this driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove RT_TRACE prints from rtl8188e_hal_init.c
Martin Kaiser [Sun, 20 Jun 2021 17:52:51 +0000 (19:52 +0200)]
staging: rtl8188eu: remove RT_TRACE prints from rtl8188e_hal_init.c

Eventually, all driver-specific debug prints should be removed.
Take another step in that direction.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove RT_TRACE prints from usb_intf.c
Martin Kaiser [Sun, 20 Jun 2021 17:52:50 +0000 (19:52 +0200)]
staging: rtl8188eu: remove RT_TRACE prints from usb_intf.c

Eventually, all driver-specific debug prints should be removed.
Take another step in that direction.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: handle errors from dev_alloc_name
Martin Kaiser [Sun, 20 Jun 2021 17:52:49 +0000 (19:52 +0200)]
staging: rtl8188eu: handle errors from dev_alloc_name

Fail the usb interface initialization if dev_alloc_name returns an error.

Other wlan drivers like natsemi or atmel use the same error handling.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: fix usb_submit_urb error handling
Martin Kaiser [Sun, 20 Jun 2021 17:40:57 +0000 (19:40 +0200)]
staging: rtl8188eu: fix usb_submit_urb error handling

usb_read_port prepares a bulk in urb and calls usb_submit_urb to pass the
usb to the usb core. It seems wrong that usb_read_port returns success to
its caller if usb_submit_urb failed with -EPERM.

According to drivers/usb/core/urb.c, usb_submit_urb returns -EPERM when
an urb is resubmitted after being cancelled by usb_kill_urb etc.

The only caller who checks the return value of usb_read_port is
rtw_hal_inirp_init. This function submits the bulk in urbs for the first
time after the netdevice is opened. We'll not receive -EPERM from
usb_submit_urb in this case. The urbs are resubmitted by
read_port_complete, which does not check for errors from usb_read_port.

This driver may kill pending bulk in urbs when the netdevice is closed when
the driver is unloaded or the system goes to sleep. I don't think that this
will interrupt an ongoing netdev open.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620174057.10201-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove "rtw_ieee80211_back_parties"
Christophe JAILLET [Sat, 19 Jun 2021 20:14:34 +0000 (22:14 +0200)]
staging: rtl8188eu: remove "rtw_ieee80211_back_parties"

This enum is unused. It is also close to "ieee80211_back_parties" in
"include/linux/ieee80211.h", which should be used if needed.

So remove it

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f389e0d54a5a8a46c9a696207541aa1cb433676b.1624132543.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove "rtw_ieee80211_back_actioncode"
Christophe JAILLET [Sat, 19 Jun 2021 20:14:20 +0000 (22:14 +0200)]
staging: rtl8188eu: remove "rtw_ieee80211_back_actioncode"

This enum is the same as "ieee80211_back_actioncode" in
"include/linux/ieee80211.h".

Update the code accordingly and remove useless comment.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/6b6d8d81e7b2115e9206d2960ce09e1b2e8b6381.1624132543.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove useless comment
Michael Straube [Sat, 19 Jun 2021 17:50:55 +0000 (19:50 +0200)]
staging: rtl8188eu: remove useless comment

Remove block comment about function HwSuspendModeEnable92Cu.
The comment contains no useful information and there is even
no HwSuspendModeEnable92Cu function in the driver code.
'git grep -n HwSuspendModeEnable92Cu drivers/staging/rtl8188eu'
returns nothing.

Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210619175055.5122-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: Fix an error handling path
Christophe JAILLET [Sun, 20 Jun 2021 08:21:31 +0000 (10:21 +0200)]
staging: rtl8723bs: Fix an error handling path

'ret' is known to be 0 at this point. It must be set to -ENOMEM if a
memory allocation occurs.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/a9533d1594900152e1e64e9f09e54240e3b7062a.1624177169.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: rtw_efuse: Fix coding style
Shreyas Krishnakumar [Wed, 16 Jun 2021 07:39:21 +0000 (13:09 +0530)]
staging: rtl8723bs: rtw_efuse: Fix coding style

Remove unnecessary braces around single statement blocks as warned by
checkpatch.pl

Signed-off-by: Shreyas Krishnakumar <shreyaskumar1035@gmail.com>
Link: https://lore.kernel.org/r/20210616073921.156814-1-shreyaskumar1035@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: hal: use eth_broadcast_addr() to assign broadcast address
Yang Yingliang [Wed, 16 Jun 2021 08:12:43 +0000 (16:12 +0800)]
staging: rtl8723bs: hal: use eth_broadcast_addr() to assign broadcast address

Using eth_broadcast_addr() to assign broadcast address instead
of copying from an array that contains the all-ones broadcast
address.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210616081243.2511663-4-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: core: use eth_broadcast_addr() to assign broadcast address
Yang Yingliang [Wed, 16 Jun 2021 08:12:42 +0000 (16:12 +0800)]
staging: rtl8723bs: core: use eth_broadcast_addr() to assign broadcast address

Using eth_broadcast_addr() to assign broadcast address instead
of copying from an array that contains the all-ones broadcast
address.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210616081243.2511663-3-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: os_dep: use eth_broadcast_addr() to assign broadcast address
Yang Yingliang [Wed, 16 Jun 2021 08:12:41 +0000 (16:12 +0800)]
staging: rtl8723bs: os_dep: use eth_broadcast_addr() to assign broadcast address

Using eth_broadcast_addr() to assign broadcast address instead
of memset() or copying from an array that contains the all-ones
broadcast address.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210616081243.2511663-2-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu/core: remove the check for NULL pointer in _rtw_enqueue_cmd()
Qiang Ma [Wed, 16 Jun 2021 12:53:32 +0000 (20:53 +0800)]
staging: r8188eu/core: remove the check for NULL pointer in _rtw_enqueue_cmd()

Remove the check for _rtw_enqueue_cmd(), because
rtw_enqueue_cmd() already has a check of NULL pointer,
so this condition is not possible.

Signed-off-by: Qiang Ma <maqianga@uniontech.com>
Link: https://lore.kernel.org/r/20210616125332.31674-1-maqianga@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: ks7010: Wrap macro definitions in parenthesis
Caleb D.S. Brzezinski [Wed, 16 Jun 2021 21:26:03 +0000 (21:26 +0000)]
staging: ks7010: Wrap macro definitions in parenthesis

Wrap the definition of TX_RATE_* constants in parenthesis to prevent
incorrect casting during expansion, as recommended by checkpatch.pl.

Signed-off-by: Caleb D.S. Brzezinski <calebdsb@protonmail.com>
Link: https://lore.kernel.org/r/20210616212552.117604-1-calebdsb@protonmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rts5208: remove redundant continue statement
Colin Ian King [Thu, 17 Jun 2021 12:04:11 +0000 (13:04 +0100)]
staging: rts5208: remove redundant continue statement

The continue statement at the end of a for-loop has no effect,
remove it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Continue has no effect")
Link: https://lore.kernel.org/r/20210617120411.11612-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: ashmem: add size field in procfs fdinfo
liuhailong [Fri, 18 Jun 2021 09:50:35 +0000 (17:50 +0800)]
staging: android: ashmem: add size field in procfs fdinfo

add this information to help user to find ashmem problem.

ashmem leak scenario:
-000|fd = ashmem_create_region
-001|mmap and pagefault
-002|munmap
-003|forget close(fd) <---- which lead to ashmem leak

Signed-off-by: liuhailong <liuhailong@oppo.com>
收件人: 刘海龙(DuckBuBee) <liuhailong@oppo.com>
Link: https://lore.kernel.org/r/20210618095035.32410-1-liuhailong@oppo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMerge tag 'iio-for-5.14b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Thu, 17 Jun 2021 16:20:56 +0000 (18:20 +0200)]
Merge tag 'iio-for-5.14b' of https://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of Counter and IIO new device support, cleanups etc for 5.14

Counter
------

First part of general rework of counter subsystem to add a chrdev interface
for event drive data capture.  Most of it will hopefully land next cycle.

* Consolidate documentation to avoid multiple copies of same docs in per
  device files.
* Constify various arrays etc across subsystem.
* 104-quad-8:
  - Annotate the module config parameter to avoid using it when kernel is
    locked down.
  - Spelling and trivial comment drops etc
* Intel QEP
  - Follow up cleanups of trivial stuff from initial patch series.

IIO
---

Includes some cleanups as part of two ongoing audits
- runtime pm usage in IIO.
- Insufficient alignment on buffers passed to
iio_push_to_buffers_with_timstamp()

New device support
* bosch,bmc150
  - Add ID for BMA253

Minor features / cleanups / minor fixes / late breaking fixes
* iio_push_to_buffers_with_timestamp() alignment fixes.
  This set includes those where the best option is to mark the buffer as
  __aligned(8). Normally this choice was made because there is too high a degree
  of possible variation in number of channels enabled to be able to guarantee
  the timestamp was always in the same location.  This ruled out the more
  obvious structure form used in other drivers. Only one small class of
  related issues have patches under review and we can finally tighten up the
  explicit rules to reflect the hidden requirement.

* dummy
  - Kconfig build dependency fix.
* adi,ad_sigma_delta
  - General devm related simplifications for these devices.
* adi,adf4350
  - Fix some missing cleanup on error path.
* adi,adis, ADC drivers.
  - Clean out unneeded spi_set_drvdata()
* ams-taos,tcs3472
  - Fix a potential free of an irq that was never allocated.
* atlas,sensor
  - Drop unbalanced runtime pm call and use pm_runtime_resume_and_get()
    to reduce boilerplate.
* bosch,bma180
  - Fix bandwidth register values used.
* bosch,bmc150
  - Fix wrong pointer being dereferenced in remove.
  - Stop device trying unregister itself rather than the second device.
  - Refactor ACPI second device handing.
  - Add support for DUAL250E ACPI HID.
  - Move some stuff into the header to enable following patches to not
    add additional accessor functions. Drop existing accessors.
  - Add support for hinge angle setting with DUAL250E ACPI DSM to ensure
    keyboard and touchpad enabled correctly when in laptop mode and disabled
    otherwise.
  - Add label attr for the multiple sensor locations with DUAL250E ACPI HID.
  - Fix scale units for bma222
  - Various reordering of devices supported lists to be alphabetical order.
  - Drop unnecessary duplicated chip_info_tbl[] entries.
  - Document that some devices have two interrupts, even if not currently
    used by the driver.
  - Move bma254 over to the bma255 driver.
  - Move to more consistent scale values, based on assumption that some
    datasheets use lower precision in their calculations in comparison
    with others.
* hid-sensors
  - Use namespaces for exported symbols.
  - Update includes using manual inspection of output of the
    include-what-you-use tool.
* invensense,icp10100
  - Drop unbalanced runtime pm put. Use pm_runtime_resume_and_get() to cleanly
    handle potential error.
* invensense,mpu6050
  - Drop use of %hhx string formatting.
  - runtime pm boilerplate removal and drop an unbalanced call in remove.
* liteon,ltr501
  - Fix inaccurate volatile register list.
  - Fix wrong mode bit.
  - Add a missing leXX_to_cpu() conversion.
  - Mark ltr501_chip_info structure as const.
* pulsed-light-lidar:
  - Boilerplate removal using runtime_pm_resume_and_get()
* scmi-sensors
  - Formatting of SPDX fix.
* silabs,si1133
  - Fix a string format warning.
  - Drop remaining uses of %hhx string formatting.
* silabs,si1145
  - Drop use of %hhx string formatting.
* ti,ads1015
  - Drop unbalanced runtime pm call in remove and reduce boilerplate.

* tag 'iio-for-5.14b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (76 commits)
  iio: light: tcs3472: do not free unallocated IRQ
  iio: accel: bmc150: Use more consistent and accurate scale values
  iio: hid-sensors: Update header includes
  iio: pressure: icp10100: Balance runtime pm + use pm_runtime_resume_and_get()
  iio: prox: pulsed-light-v2: Use pm_runtime_resume_and_get()
  iio: chemical: atlas-sensor: Balance runtime pm + pm_runtime_resume_and_get()
  iio: adc: ads1015: Balance runtime pm + pm_runtime_resume_and_get()
  iio: imu: mpu6050: Balance runtime pm + use pm_runtime_resume_and_get()
  iio: hid-sensors: lighten exported symbols by moving to IIO_HID namespace
  iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: light: vcnl4000: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()
  iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()
  iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  counter: interrupt-cnt: Add const qualifier for actions_list array
  iio: ltr501: mark ltr501_chip_info as const
  iio: ltr501: ltr501_read_ps(): add missing endianness conversion
  ...

3 years agoiio: light: tcs3472: do not free unallocated IRQ
frank zago [Tue, 27 Apr 2021 02:20:17 +0000 (21:20 -0500)]
iio: light: tcs3472: do not free unallocated IRQ

Allocating an IRQ is conditional to the IRQ existence, but freeing it
was not. If no IRQ was allocate, the driver would still try to free
IRQ 0. Add the missing checks.

This fixes the following trace when the driver is removed:

[  100.667788] Trying to free already-free IRQ 0
[  100.667793] WARNING: CPU: 0 PID: 2315 at kernel/irq/manage.c:1826 free_irq+0x1fd/0x370
...
[  100.667914] Call Trace:
[  100.667920]  tcs3472_remove+0x3a/0x90 [tcs3472]
[  100.667927]  i2c_device_remove+0x2b/0xa0

Signed-off-by: frank zago <frank@zago.net>
Link: https://lore.kernel.org/r/20210427022017.19314-2-frank@zago.net
Fixes: 9d2f715d592e ("iio: light: tcs3472: support out-of-threshold events")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bmc150: Use more consistent and accurate scale values
Stephan Gerhold [Fri, 11 Jun 2021 18:24:42 +0000 (20:24 +0200)]
iio: accel: bmc150: Use more consistent and accurate scale values

It is quite strange that BMA222 and BMA222E have very close, yet
subtly different values in their scale tables. Comparing the datasheets
this is simply because the "Resolution" for the different measurement
ranges are documented with different precision.

For example, for +-2g the BMA222 datasheet [1] suggests a resolution
of 15.6 mg/LSB, while the BMA222E datasheet [2] suggests 15.63 mg/LSB.

Actually, there is no need to rely on the resolution given by the Bosch
datasheets. The resolution and scale can be calculated more consistently
and accurately using the range (e.g. +-2g) and the channel size (e.g. 8 bits).

Distributing 4g (-2g to 2g) over 8 bits results in an exact resolution
of (4g / 2^8) = 15.625 mg/LSB which is the same value as in both datasheets,
just slightly more accurate. Multiplying g = 9.80665 m/s^2 we get a more
accurate value for the IIO scale table.

Generalizing this we can calculate the scale tables more accurately using
(range / 2^bits) * g * 10^6 (because of IIO_VAL_INT_PLUS_MICRO).

Document this and make the scale tables more consistent and accurate
for all the variants using that formula. Now the scale tables for
BMA222 and BMA222E are consistent and probably slightly more accurate.

[1]: https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA222.pdf
[2]: https://www.mouser.com/datasheet/2/783/BST-BMA222E-DS004-06-1021076.pdf

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gnail.com>
Link: https://lore.kernel.org/r/20210611182442.1971-1-stephan@gerhold.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: hid-sensors: Update header includes
Jonathan Cameron [Tue, 8 Jun 2021 20:55:10 +0000 (21:55 +0100)]
iio: hid-sensors: Update header includes

General driver churn doesn't always include updates of header includes.
Manual review of the output of the include-what-you-use checker lead to the
following cleanup. Hopefuly this brings things back to a good state for the
hid-sensor drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20210608205510.4033887-1-jic23@kernel.org
3 years agoiio: pressure: icp10100: Balance runtime pm + use pm_runtime_resume_and_get()
Jonathan Cameron [Sun, 16 May 2021 16:21:03 +0000 (17:21 +0100)]
iio: pressure: icp10100: Balance runtime pm + use pm_runtime_resume_and_get()

The devm_ handled runtime pm disable calls pm_runtime_put_sync_suspend()
which isn't balancing a matching get call.  It isn't a bug as such,
because the runtime pm core doesn't decrement the reference count below
zero, but it is missleading so let's drop it.

Using pm_runtime_resume_and_get() new call makes it easy to handle
failures in resume as it doesn't hold a reference count if it exits
with an error.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210516162103.1332291-7-jic23@kernel.org
3 years agoiio: prox: pulsed-light-v2: Use pm_runtime_resume_and_get()
Jonathan Cameron [Sun, 16 May 2021 16:21:02 +0000 (17:21 +0100)]
iio: prox: pulsed-light-v2: Use pm_runtime_resume_and_get()

Using this new call makes it easy to handle any errors as a result
of runtime resume as it exits without leaving the reference count
elevated.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210516162103.1332291-6-jic23@kernel.org
3 years agoiio: chemical: atlas-sensor: Balance runtime pm + pm_runtime_resume_and_get()
Jonathan Cameron [Sun, 16 May 2021 16:21:00 +0000 (17:21 +0100)]
iio: chemical: atlas-sensor: Balance runtime pm + pm_runtime_resume_and_get()

The pm_runtime_put_noidle() call in remove isn't balanced with any get, so
drop it.  Note this isn't a bug as the runtime pm core will not allow the
reference count to go negative, making this a noop. However, it is
confusing to the reader so let's drop it.

pm_runtime_resume_and_get() replacement found using the coccicheck script
under review at:
https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/

As pm_runtime_resume_and_get() returns <= 0 take advantage of that to
change the error checking to if (ret) which is more in keeping with the
rest of this driver.

This is a prequel to taking a closer look at the runtime pm in IIO drivers
in general.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210516162103.1332291-4-jic23@kernel.org
3 years agoiio: adc: ads1015: Balance runtime pm + pm_runtime_resume_and_get()
Jonathan Cameron [Sun, 16 May 2021 16:20:59 +0000 (17:20 +0100)]
iio: adc: ads1015: Balance runtime pm + pm_runtime_resume_and_get()

The call to pm_runtime_put_noidle() in remove() is not balancing a
counter increment.  Note this doesn't matter as the runtime pm core
will not allow the counter to go negative.  However, it is confusing
to the reader so let's remove it.

The pm_runtime_resume_and_get() replacement was found using coccicheck
script under review at:
https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/

This is a prequel to taking a closer look at the runtime pm in IIO drivers
in general.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210516162103.1332291-3-jic23@kernel.org
3 years agoiio: imu: mpu6050: Balance runtime pm + use pm_runtime_resume_and_get()
Jonathan Cameron [Sun, 16 May 2021 16:20:58 +0000 (17:20 +0100)]
iio: imu: mpu6050: Balance runtime pm + use pm_runtime_resume_and_get()

Remove an unblanced pm_runtime_put_sync_suspend() call
in inv_pu_pm_disable().  Not this call is not a bug, because the runtime
pm core will not allow the reference counter to go negative.  It is
however confusing and serves no purpose.

pm_runtime_resume_and_get() case found using coccicheck script under
review at:
https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/

pm_runtime_resume_and_get() returns <= 0 only so simplify related checks
to bring this more inline with nearby calls.

This is a prequel to taking a closer look at the runtime pm in IIO drivers
in general.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210516162103.1332291-2-jic23@kernel.org
3 years agoiio: hid-sensors: lighten exported symbols by moving to IIO_HID namespace
Andy Shevchenko [Mon, 14 Jun 2021 16:24:47 +0000 (19:24 +0300)]
iio: hid-sensors: lighten exported symbols by moving to IIO_HID namespace

A namespace for exported symbols makes clear who is a provider
and who is a consumer of the certain resources. Besides that,
it doesn't pollute the common namespace.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20210614162447.5392-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
Jonathan Cameron [Sun, 13 Jun 2021 15:23:01 +0000 (16:23 +0100)]
iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Add __aligned(8) to ensure the buffer passed to
iio_push_to_buffers_with_timestamp() is suitable for the naturally
aligned timestamp that will be inserted.

Here an explicit structure is not used, because the holes would
necessitate the addition of an explict memset(), to avoid a kernel
data leak, making for a less minimal fix.

Fixes: 1c28799257bc ("iio: light: isl29501: Add support for the ISL29501 ToF sensor.")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Mathieu Othacehe <m.othacehe@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210613152301.571002-9-jic23@kernel.org
3 years agoiio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
Jonathan Cameron [Sun, 13 Jun 2021 15:23:00 +0000 (16:23 +0100)]
iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Add __aligned(8) to ensure the buffer passed to
iio_push_to_buffers_with_timestamp() is suitable for the naturally
aligned timestamp that will be inserted.

Here an explicit structure is not used, because the holes would
necessitate the addition of an explict memset(), to avoid a potential
kernel data leak, making for a less minimal fix.

Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Parthiban Nallathambi <pn@denx.de>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210613152301.571002-8-jic23@kernel.org
3 years agostaging: rtl8188eu: remove _dbg_dump_tx_info function
Phillip Potter [Tue, 15 Jun 2021 22:36:07 +0000 (23:36 +0100)]
staging: rtl8188eu: remove _dbg_dump_tx_info function

Remove the _dbg_dump_tx_info function from hal/rtl8188e_xmit.c, as
it doesn't actually do anything and is only called from one place.
It used to have some redundant debugging statements in it, but these
have now been removed anyway, so all it does is read information from
the adapter to set a variable 'dump_txdesc' which is then never used.
This fixes a kernel test robot warning.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210615223607.13863-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused variables from hal/rtl8188e_cmd.c
Phillip Potter [Tue, 15 Jun 2021 22:36:06 +0000 (23:36 +0100)]
staging: rtl8188eu: remove unused variables from hal/rtl8188e_cmd.c

Remove set but unused variables from within the file hal/rtl8188e_cmd.c
in the function rtl8188e_set_FwMediaStatus_cmd, as they are triggering
kernel test robot warnings.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210615223607.13863-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused variable from os_dep/ioctl_linux.c
Phillip Potter [Tue, 15 Jun 2021 22:36:05 +0000 (23:36 +0100)]
staging: rtl8188eu: remove unused variable from os_dep/ioctl_linux.c

Remove set but unused variable 'reason' from within the file
os_dep/ioctl_linux.c in the function rtw_wx_set_mlme, as it is
triggering a kernel test robot warning.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210615223607.13863-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused variables from core/rtw_mlme_ext.c
Phillip Potter [Tue, 15 Jun 2021 22:36:04 +0000 (23:36 +0100)]
staging: rtl8188eu: remove unused variables from core/rtw_mlme_ext.c

Remove set but unused variables from within the file core/rtw_mlme_ext.c,
as they are triggering kernel test robot warnings.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210615223607.13863-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused variables from core/rtw_efuse.c
Phillip Potter [Tue, 15 Jun 2021 22:36:03 +0000 (23:36 +0100)]
staging: rtl8188eu: remove unused variables from core/rtw_efuse.c

Remove set but unused variables from within the file core/rtw_efuse.c
in the function efuse_read_phymap_from_txpktbuf, as they are triggering
kernel test robot warnings. Also, remove the local 'lenc' array as well,
as nothing is done with its values. Keep the two usb_read8 calls
however, as this patch is purely for warnings, not to change behaviour
of the code.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210615223607.13863-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: use prefix decrement operator on trycnt variable
Phillip Potter [Tue, 15 Jun 2021 22:36:02 +0000 (23:36 +0100)]
staging: rtl8188eu: use prefix decrement operator on trycnt variable

Modify trycnt condition in the do/while loop of rtw_hal_set_hwreg to use
a prefix decrement operator instead of postfix. As an unsigned 8-bit
integer, this value would actually be 255 after the end of the do/while
loop, which is almost certainly not what was intended. It is more
reasonable to assume a loop counter should be zero at the end of all
loop iterations. Indeed, the line following the loop previously contained
an if statement which assumed trycnt was 0, and therefore was never
triggered.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210615223607.13863-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove empty label from mlmeext_joinbss_event_callback
Phillip Potter [Tue, 15 Jun 2021 22:36:01 +0000 (23:36 +0100)]
staging: rtl8188eu: remove empty label from mlmeext_joinbss_event_callback

Remove empty label at end of mlmeext_joinbss_event_callback function, as
it only contained a return in my last patch to make the code build. It
is better removed, and the corresponding goto converted to a return.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210615223607.13863-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>