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

staging: r8188eu: remove bLedNoLinkBlinkInProgress

Remove the bLedNoLinkBlinkInProgress state variable. Its sole purpose is
to block subsequent requests for "no link" blinking when this blinking
pattern is already active.

It's perfectly safe to restart "no link" blinking. We can remove
bLedNoLinkBlinkInProgress and the many places where it's updated.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220918175700.215170-4-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b08d8999
......@@ -27,7 +27,6 @@ static void ResetLedStatus(struct led_priv *pLed)
pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */
pLed->BlinkingLedState = LED_UNKNOWN; /* Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. */
pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = false;
}
......@@ -121,7 +120,6 @@ static void blink_work(struct work_struct *work)
pLed->CurrLedState = LED_BLINK_NORMAL;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
} else {
pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
}
......@@ -142,7 +140,6 @@ static void blink_work(struct work_struct *work)
pLed->CurrLedState = LED_BLINK_NORMAL;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
} else {
pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
}
......@@ -217,9 +214,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
switch (LedAction) {
case LED_CTL_START_TO_LINK:
case LED_CTL_NO_LINK:
if (pLed->bLedNoLinkBlinkInProgress)
return;
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
return;
......@@ -227,7 +221,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
if (pLed->bLedOn)
......@@ -245,7 +238,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = true;
......@@ -268,7 +260,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = true;
......@@ -291,7 +282,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = true;
......@@ -309,7 +299,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = false;
......@@ -324,7 +313,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
case LED_CTL_STOP_WPS:
cancel_delayed_work(&pLed->blink_work);
pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = false;
......@@ -342,7 +330,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
case LED_CTL_STOP_WPS_FAIL:
cancel_delayed_work(&pLed->blink_work);
pLed->bLedWPSBlinkInProgress = false;
pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
if (pLed->bLedOn)
pLed->BlinkingLedState = RTW_LED_OFF;
......@@ -353,7 +340,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
case LED_CTL_POWER_OFF:
pLed->CurrLedState = RTW_LED_OFF;
pLed->BlinkingLedState = RTW_LED_OFF;
pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedWPSBlinkInProgress = false;
......
......@@ -54,7 +54,6 @@ struct led_priv {
u32 BlinkTimes; /* Number of times to toggle led state for blinking. */
bool bLedNoLinkBlinkInProgress;
bool bLedLinkBlinkInProgress;
bool bLedScanBlinkInProgress;
struct delayed_work blink_work;
......
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