[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211226195556.159471-8-martin@kaiser.cx>
Date: Sun, 26 Dec 2021 20:55:42 +0100
From: Martin Kaiser <martin@...ser.cx>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Michael Straube <straube.linux@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Martin Kaiser <martin@...ser.cx>
Subject: [PATCH 07/21] staging: r8188eu: clean up the blink worker code
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@...ser.cx>
---
drivers/staging/r8188eu/core/rtw_led.c | 13 ++++---------
drivers/staging/r8188eu/include/rtw_led.h | 4 ----
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index 52e31d3307df..517aef664bfc 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -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)
diff --git a/drivers/staging/r8188eu/include/rtw_led.h b/drivers/staging/r8188eu/include/rtw_led.h
index 984fba6363ad..cd9e40aa7c65 100644
--- a/drivers/staging/r8188eu/include/rtw_led.h
+++ b/drivers/staging/r8188eu/include/rtw_led.h
@@ -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_ */
--
2.30.2
Powered by blists - more mailing lists