[PATCH 6.0 0002/1073] staging: r8188eu: dont check bSurpriseRemoved in SwLedOff

Greg Kroah-Hartman
2022-12-28T14:44:47Z

From: Martin Kaiser <martin@kaiser.cx>

[ Upstream commit 647085006beb2cc41bef27a24f249f4dec3c1e15 ]

The SwLedOff function calls rtw_read8 which in turn calls usb_read.

bSurpriseRemoved is checked in usb_read. We don't have to check it again
in SwLedOff.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220925140406.112991-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 12c6223fc180 ("staging: r8188eu: fix led register settings")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/r8188eu/core/rtw_led.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index e889e7861706..42e35953fd7b 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -53,7 +53,7 @@ static void SwLedOff(struct adapter *padapter, struct led_priv *pLed)
u8 LedCfg;
int res;

- if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
+ if (padapter->bDriverStopped)
goto exit;

res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */
--
2.35.1