staging: r8188eu: clean up the blink worker code
authorMartin Kaiser <martin@kaiser.cx>
Sun, 26 Dec 2021 19:55:42 +0000 (20:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Dec 2021 16:12:34 +0000 (17:12 +0100)
Merge the BlinkWorkItemCallback and BlinkHandler functions.
Rename the resulting function to blink_work and make it
internal to the led layer.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211226195556.159471-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_led.c
drivers/staging/r8188eu/include/rtw_led.h

index 52e31d3307df4a0274d34ac621f4664e01b64779..517aef664bfcfa78290243ea4b4ac3ae575960da 100644 (file)
@@ -5,13 +5,6 @@
 #include "../include/rtw_led.h"
 #include "../include/rtl8188e_spec.h"
 
-void BlinkWorkItemCallback(struct work_struct *work)
-{
-       struct delayed_work *dwork = to_delayed_work(work);
-       struct LED_871x *pLed = container_of(dwork, struct LED_871x, blink_work);
-       BlinkHandler(pLed);
-}
-
 static void ResetLedStatus(struct LED_871x *pLed)
 {
        pLed->CurrLedState = RTW_LED_OFF; /*  Current LED state. */
@@ -391,8 +384,10 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
        }
 }
 
-void BlinkHandler(struct LED_871x *pLed)
+static void blink_work(struct work_struct *work)
 {
+       struct delayed_work *dwork = to_delayed_work(work);
+       struct LED_871x *pLed = container_of(dwork, struct LED_871x, blink_work);
        struct adapter *padapter = pLed->padapter;
 
        if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
@@ -410,7 +405,7 @@ void rtl8188eu_InitSwLeds(struct adapter *padapter)
 
        pLed->padapter = padapter;
        ResetLedStatus(pLed);
-       INIT_DELAYED_WORK(&pLed->blink_work, BlinkWorkItemCallback);
+       INIT_DELAYED_WORK(&pLed->blink_work, blink_work);
 }
 
 void rtl8188eu_DeInitSwLeds(struct adapter *padapter)
index 984fba6363ade85969a2fef1a975d4bc4150659c..cd9e40aa7c657d09cc3f71fddc2aeeaaad5e2057 100644 (file)
@@ -100,11 +100,7 @@ struct led_priv{
                        (adapt)->ledpriv.LedControlHandler((adapt), (action)); \
        } while (0)
 
-void BlinkWorkItemCallback(struct work_struct *work);
-
 void rtl8188eu_InitSwLeds(struct adapter *padapter);
 void rtl8188eu_DeInitSwLeds(struct adapter *padapter);
 
-void BlinkHandler(struct LED_871x * pLed);
-
 #endif /* __RTW_LED_H_ */