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

staging: r8188eu: always cancel blink_work before WPS blinking

In rtw_led_control, we can always cancel a running blink worker when we
start WPS blinking.

The worker will be scheduled again and there's no point in having more
than one pending blink worker.
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-4-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a5f01428
......@@ -312,22 +312,19 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
if (pLed->bLedWPSBlinkInProgress)
return;
if (pLed->bLedNoLinkBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
cancel_delayed_work(&pLed->blink_work);
if (pLed->bLedNoLinkBlinkInProgress)
pLed->bLedNoLinkBlinkInProgress = false;
}
if (pLed->bLedLinkBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
if (pLed->bLedLinkBlinkInProgress)
pLed->bLedLinkBlinkInProgress = false;
}
if (pLed->bLedBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
if (pLed->bLedBlinkInProgress)
pLed->bLedBlinkInProgress = false;
}
if (pLed->bLedScanBlinkInProgress) {
cancel_delayed_work(&pLed->blink_work);
if (pLed->bLedScanBlinkInProgress)
pLed->bLedScanBlinkInProgress = false;
}
pLed->bLedWPSBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_WPS;
if (pLed->bLedOn)
......
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