public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] [PATCH] staging: rtl8723bs: change error handling to use standard errno
@ 2026-03-20  7:29 Omer El Idrissi
  2026-03-20  7:35 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Omer El Idrissi @ 2026-03-20  7:29 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Omer El Idrissi

Replace non-standard return values with descriptive
linux kernel error codes in probe path.
Also replace the variable name 'status' with 'ret'
to be more consistent with other kernel code

Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 30 +++++++++++++-------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index d664e254912c..ff0ebcb59c68 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -345,38 +345,46 @@ static int rtw_drv_init(
 	struct sdio_func *func,
 	const struct sdio_device_id *id)
 {
-	int status = _FAIL;
+	int ret;
 	struct adapter *if1 = NULL;
 	struct dvobj_priv *dvobj;
 
 	dvobj = sdio_dvobj_init(func);
-	if (!dvobj)
+	if (!dvobj) {
+		ret = -ENOMEM;
 		goto exit;
+	}
 
 	if1 = rtw_sdio_if1_init(dvobj, id);
-	if (!if1)
+	if (!if1) {
+		ret = -ENOMEM;
 		goto free_dvobj;
+	}
 
 	/* dev_alloc_name && register_netdev */
-	status = rtw_drv_register_netdev(if1);
-	if (status != _SUCCESS)
+	ret = rtw_drv_register_netdev(if1);
+	if (ret) {
+		ret = -EIO;
 		goto free_if1;
+	}
 
-	status = sdio_alloc_irq(dvobj);
-	if (status != _SUCCESS)
+	ret = sdio_alloc_irq(dvobj);
+	if (ret) {
+		ret = -EIO;
 		goto free_if1;
+	}
 
-	status = _SUCCESS;
+	ret = _SUCCESS;
 
 free_if1:
-	if (status != _SUCCESS && if1)
+	if (ret != _SUCCESS && if1)
 		rtw_sdio_if1_deinit(if1);
 
 free_dvobj:
-	if (status != _SUCCESS)
+	if (ret != _SUCCESS)
 		sdio_dvobj_deinit(func);
 exit:
-	return status == _SUCCESS ? 0 : -ENODEV;
+	return ret;
 }
 
 static void rtw_dev_remove(struct sdio_func *func)
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-21 21:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20  7:29 [PATCH] [PATCH] staging: rtl8723bs: change error handling to use standard errno Omer El Idrissi
2026-03-20  7:35 ` Greg KH
2026-03-20  7:36 ` Greg KH
     [not found]   ` <CACx49NfzUuHWdvME+850gJXLL==6x8Yw3_0yzZgJmAk089a7Aw@mail.gmail.com>
2026-03-20  8:47     ` Omer
2026-03-20  9:48 ` [PATCH v2] " Omer El Idrissi
2026-03-21  7:03   ` Greg KH
2026-03-21 20:17 ` Omer El Idrissi
2026-03-21 21:24   ` Dan Carpenter
2026-03-21 21:34     ` Omer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox