linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Brattlof <hello@bryanbrattlof.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bryan Brattlof <hello@bryanbrattlof.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: rtl8723bs: use generic kernel error codes
Date: Tue, 04 May 2021 16:07:48 +0000	[thread overview]
Message-ID: <c94e5865e59d35fe0e39d5cd46d71ad4a752ddd4.1620144194.git-series.hello@bryanbrattlof.com> (raw)

The current _FAIL and _SUCCESS error codes are defined as:

        #define _FAIL    0
	#define _SUCCESS 1

which adds complexity (and confusion) when interacting with other
submodules in the kernel. These definitions can be removed and replaced
with the kernel's generic error codes.

Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
---
 drivers/staging/rtl8723bs/include/drv_types.h |  2 +-
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c  | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
index 83d43e5726dd..5b702ff432ae 100644
--- a/drivers/staging/rtl8723bs/include/drv_types.h
+++ b/drivers/staging/rtl8723bs/include/drv_types.h
@@ -385,7 +385,7 @@ struct adapter {
 	void *xmitThread;
 	void *recvThread;

-	u32 (*intf_init)(struct dvobj_priv *dvobj);
+	int (*intf_init)(struct dvobj_priv *dvobj);
 	void (*intf_deinit)(struct dvobj_priv *dvobj);
 	int (*intf_alloc_irq)(struct dvobj_priv *dvobj);
 	void (*intf_free_irq)(struct dvobj_priv *dvobj);
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index d2bf444117b8..e26c51d847b6 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -112,7 +112,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
 	}
 }

-static u32 sdio_init(struct dvobj_priv *dvobj)
+static int sdio_init(struct dvobj_priv *dvobj)
 {
 	struct sdio_data *psdio_data;
 	struct sdio_func *func;
@@ -139,12 +139,11 @@ static u32 sdio_init(struct dvobj_priv *dvobj)
 	psdio_data->tx_block_mode = 1;
 	psdio_data->rx_block_mode = 1;

+	return err;
+
 release:
 	sdio_release_host(func);
-
-	if (err)
-		return _FAIL;
-	return _SUCCESS;
+	return err;
 }

 static void sdio_deinit(struct dvobj_priv *dvobj)
@@ -186,7 +185,7 @@ static struct dvobj_priv *sdio_dvobj_init(struct sdio_func *func)
 	psdio = &dvobj->intf_data;
 	psdio->func = func;

-	if (sdio_init(dvobj) != _SUCCESS)
+	if (sdio_init(dvobj) < 0)
 		goto free_dvobj;

 	rtw_reset_continual_io_error(dvobj);

base-commit: 9ccce092fc64d19504fa54de4fd659e279cc92e7
--
git-series 0.9.1


             reply	other threads:[~2021-05-04 16:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 16:07 Bryan Brattlof [this message]
2021-05-04 16:17 ` [PATCH] staging: rtl8723bs: use generic kernel error codes Greg Kroah-Hartman
2021-05-04 17:45   ` Bryan Brattlof
2021-05-04 17:56     ` Greg Kroah-Hartman
2021-05-04 18:52       ` Bryan Brattlof

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=c94e5865e59d35fe0e39d5cd46d71ad4a752ddd4.1620144194.git-series.hello@bryanbrattlof.com \
    --to=hello@bryanbrattlof.com \
    --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;
as well as URLs for NNTP newsgroup(s).