[PATCH] staging: rtl8723bs: use guard(mutex) in ips_enter()
From: Ivy Lopez
Date: Thu Jul 30 2026 - 19:21:56 EST
Replace manual mutex_lock()/mutex_unlock() in ips_enter() with
guard(mutex) from linux/cleanup.h. This is a single-exit function
so the conversion is a direct drop-in and removes the need to
manually balance the unlock.
Signed-off-by: Ivy Lopez <skunkolee@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index b9f8cf1014ed..141c322befb6 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -6,6 +6,7 @@
******************************************************************************/
#include <drv_types.h>
#include <hal_data.h>
+#include <linux/cleanup.h>
#include <linux/jiffies.h>
void _ips_enter(struct adapter *padapter)
@@ -37,9 +38,8 @@ void ips_enter(struct adapter *padapter)
hal_btcoex_IpsNotify(padapter, pwrpriv->ips_mode_req);
- mutex_lock(&pwrpriv->lock);
+ guard(mutex)(&pwrpriv->lock);
_ips_enter(padapter);
- mutex_unlock(&pwrpriv->lock);
}
int _ips_leave(struct adapter *padapter)
--
2.55.0