public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] rtl8723bs: replace _SUCCESS/_FAIL with standard errno
@ 2026-03-18 21:41 Omer El Idrissi
  2026-03-19  9:09 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Omer El Idrissi @ 2026-03-18 21:41 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>

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)
---
 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] 3+ messages in thread

* Re: [PATCH] rtl8723bs: replace _SUCCESS/_FAIL with standard errno
  2026-03-18 21:41 [PATCH] rtl8723bs: replace _SUCCESS/_FAIL with standard errno Omer El Idrissi
@ 2026-03-19  9:09 ` Dan Carpenter
  2026-03-20  7:05   ` Omer El Idrissi
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2026-03-19  9:09 UTC (permalink / raw)
  To: Omer El Idrissi; +Cc: gregkh, linux-staging, linux-kernel

On Wed, Mar 18, 2026 at 10:41:03PM +0100, Omer El Idrissi wrote:
> 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>

This doesn't apply.  I don't think you're working against staging-next.

regards,
dan carpenter


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

* Re: [PATCH] rtl8723bs: replace _SUCCESS/_FAIL with standard errno
  2026-03-19  9:09 ` Dan Carpenter
@ 2026-03-20  7:05   ` Omer El Idrissi
  0 siblings, 0 replies; 3+ messages in thread
From: Omer El Idrissi @ 2026-03-20  7:05 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: gregkh, linux-staging, linux-kernel

Apologies. I forgot to switch the branch. I'll resubmit the patch 
against staging-next

On 3/19/26 10:09 AM, Dan Carpenter wrote:
> On Wed, Mar 18, 2026 at 10:41:03PM +0100, Omer El Idrissi wrote:
>> 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>
> This doesn't apply.  I don't think you're working against staging-next.
>
> regards,
> dan carpenter
>

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

end of thread, other threads:[~2026-03-20  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 21:41 [PATCH] rtl8723bs: replace _SUCCESS/_FAIL with standard errno Omer El Idrissi
2026-03-19  9:09 ` Dan Carpenter
2026-03-20  7:05   ` Omer El Idrissi

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