staging: r8188eu: drop some stop/removed checks in the led layer
cover staging: r8188eu: drop some stop/removed checks in the led layer
Here's two small patches that remove unnecessary checks of bSurpriseRemoved and bDriverStopped in the led layer.
Martin Kaiser (2):
staging: r8188eu: don't check bSurpriseRemoved in SwLedOff
staging: r8188eu: don't check for stop/removal in the blink worker
drivers/staging/r8188eu/core/rtw_led.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
2.30.2
PATCH 1/2 staging: r8188eu: don't check bSurpriseRemoved in SwLedOff
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.
--- drivers/staging/r8188eu/core/rtw_led.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_led.c +1 -1
@@ -51,7 +51,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 */
Signature · 1 line
2.30.2
PATCH 2/2 staging: r8188eu: don't check for stop/removal in the blink worker
In reply to Martin KaiserThe blink_work function calls either SwLedOff or SwLedOn. These two functions handle bSurpriseRemoved and bDriverStopped.
There's no need to check bSurpriseRemoved and bDriverStopped again in the blink worker.
--- drivers/staging/r8188eu/core/rtw_led.c | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/r8188eu/core/rtw_led.c +0 -3
@@ -77,9 +77,6 @@ static void blink_work(struct work_struct *work)struct adapter *padapter = pLed->padapter;struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped)) -return ; -if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) {SwLedOff (padapter, pLed);ResetLedStatus (pLed);
Signature · 1 line
2.30.2
Quoted 10 lines · Martin Kaiser
Here's two small patches that remove unnecessary checks of bSurpriseRemoved and bDriverStopped in the led layer.
Martin Kaiser (2):
staging: r8188eu: don't check bSurpriseRemoved in SwLedOff
staging: r8188eu: don't check for stop/removal in the blink workerdrivers/staging/r8188eu/core/rtw_led.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Quick download test is working.
Observed LED is working fine