From: Hungyu Lin <dennylin0707@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Hungyu Lin <dennylin0707@gmail.com>
Subject: [PATCH 2/2] staging: rtl8723bs: convert LPS_RF_ON_check to errno
Date: Tue, 12 May 2026 03:04:45 +0000 [thread overview]
Message-ID: <20260512030445.6360-3-dennylin0707@gmail.com> (raw)
In-Reply-To: <20260512030445.6360-2-dennylin0707@gmail.com>
Convert LPS_RF_ON_check() to return standard kernel error codes.
Replace -1 and -2 with -ETIMEDOUT and -ENODEV respectively.
No functional change intended as callers currently ignore
the return value.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 10 +++++-----
drivers/staging/rtl8723bs/include/rtw_pwrctrl.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index 7f297f2d2ff4..b0122eef5c32 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -390,10 +390,10 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode,
/*
* Return:
* 0: Leave OK
- * -1: Timeout
- * -2: Other error
+ * -ETIMEDOUT: Timeout
+ * -ENODEV: Other error
*/
-s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
+int LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
{
unsigned long start_time;
u8 bAwake = false;
@@ -405,10 +405,10 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
return 0;
if (padapter->bSurpriseRemoved)
- return -2;
+ return -ENODEV;
if (jiffies_to_msecs(jiffies - start_time) > delay_ms)
- return -1;
+ return -ETIMEDOUT;
msleep(1);
}
diff --git a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h
index c27d07861b8c..7dc9c4e2dfd2 100644
--- a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h
@@ -233,7 +233,7 @@ int ips_leave(struct adapter *padapter);
void rtw_ps_processor(struct adapter *padapter);
-s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms);
+int LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms);
void LPS_Enter(struct adapter *padapter, const char *msg);
void LPS_Leave(struct adapter *padapter, const char *msg);
void traffic_check_for_leave_lps(struct adapter *padapter, u8 tx, u32 tx_packets);
--
2.34.1
prev parent reply other threads:[~2026-05-12 3:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 3:04 [PATCH 0/2] staging: rtl8723bs: cleanup LPS_RF_ON_check Hungyu Lin
2026-05-12 3:04 ` [PATCH 1/2] staging: rtl8723bs: simplify LPS_RF_ON_check control flow Hungyu Lin
2026-05-12 3:04 ` Hungyu Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260512030445.6360-3-dennylin0707@gmail.com \
--to=dennylin0707@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox