Commit d25cb838 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: simplify the LED_CTL_POWER_OFF case

When a caller of rtw_led_control requests that the led be switched off,
we should cancel the blink worker and set all blinking state variables
to false. This does not depend on the current blinking state.
Tested-by: default avatarMichael Straube <straube.linux@gmail.com>
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905200146.82259-2-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cbdeb787
...@@ -381,26 +381,12 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) ...@@ -381,26 +381,12 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
case LED_CTL_POWER_OFF: case LED_CTL_POWER_OFF:
pLed->CurrLedState = RTW_LED_OFF; pLed->CurrLedState = RTW_LED_OFF;
pLed->BlinkingLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF;
if (pLed->bLedNoLinkBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
}
if (pLed->bLedLinkBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
pLed->bLedLinkBlinkInProgress = false; pLed->bLedLinkBlinkInProgress = false;
}
if (pLed->bLedBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
}
if (pLed->bLedWPSBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
pLed->bLedWPSBlinkInProgress = false; pLed->bLedWPSBlinkInProgress = false;
}
if (pLed->bLedScanBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
pLed->bLedScanBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false;
} cancel_delayed_work(&pLed->blink_work);
SwLedOff(padapter, pLed); SwLedOff(padapter, pLed);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment