mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	Pavel Skripkin <paskripkin@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 01/13] staging: r8188eu: Hal_MappingOutPipe should return an int
Date: Sat,  6 Aug 2022 21:55:28 +0200	[thread overview]
Message-ID: <20220806195540.777390-2-martin@kaiser.cx> (raw)
In-Reply-To: <20220806195540.777390-1-martin@kaiser.cx>

Update the Hal_MappingOutPipe function to return 0 for success or -EXNIO
if the caller requested more than the number of available endpoints.
This error code is also used by usb_find_common_endpoints if a requested
endpoint was not found.

Unlike a boolean return value, a negative error code can be returned to
external functions that call the r8188eu driver, e.g. to the caller of our
probe function.

HalUsbSetQueuePipeMapping8188EUsb passes the return value of
Hal_MappingOutPipe on to its caller. We have to change its return type
from bool to int as well.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/hal_com.c     | 8 +++-----
 drivers/staging/r8188eu/hal/usb_halinit.c | 2 +-
 drivers/staging/r8188eu/include/hal_com.h | 2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/hal_com.c b/drivers/staging/r8188eu/hal/hal_com.c
index 6a1cdc67335b..d24e0e5924eb 100644
--- a/drivers/staging/r8188eu/hal/hal_com.c
+++ b/drivers/staging/r8188eu/hal/hal_com.c
@@ -225,11 +225,10 @@ static void three_out_pipe(struct adapter *adapter, bool wifi_cfg)
 	}
 }
 
-bool Hal_MappingOutPipe(struct adapter *adapter, u8 numoutpipe)
+int Hal_MappingOutPipe(struct adapter *adapter, u8 numoutpipe)
 {
 	struct registry_priv *pregistrypriv = &adapter->registrypriv;
 	bool wifi_cfg = pregistrypriv->wifi_spec;
-	bool result = true;
 
 	switch (numoutpipe) {
 	case 2:
@@ -242,10 +241,9 @@ bool Hal_MappingOutPipe(struct adapter *adapter, u8 numoutpipe)
 		one_out_pipe(adapter);
 		break;
 	default:
-		result = false;
-		break;
+		return -ENXIO;
 	}
-	return result;
+	return 0;
 }
 
 /*
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 8b36fb56076e..ba068e6fd9fb 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -35,7 +35,7 @@ static void _ConfigNormalChipOutEP_8188E(struct adapter *adapt, u8 NumOutPipe)
 	}
 }
 
-static bool HalUsbSetQueuePipeMapping8188EUsb(struct adapter *adapt, u8 NumOutPipe)
+static int HalUsbSetQueuePipeMapping8188EUsb(struct adapter *adapt, u8 NumOutPipe)
 {
 
 	_ConfigNormalChipOutEP_8188E(adapt, NumOutPipe);
diff --git a/drivers/staging/r8188eu/include/hal_com.h b/drivers/staging/r8188eu/include/hal_com.h
index d7e333f6ce39..3dfb61e64ee0 100644
--- a/drivers/staging/r8188eu/include/hal_com.h
+++ b/drivers/staging/r8188eu/include/hal_com.h
@@ -143,7 +143,7 @@ u8 MRateToHwRate(u8 rate);
 
 void HalSetBrateCfg(struct adapter *Adapter, u8 *mBratesOS, u16 *pBrateCfg);
 
-bool Hal_MappingOutPipe(struct adapter *pAdapter, u8 NumOutPipe);
+int Hal_MappingOutPipe(struct adapter *pAdapter, u8 NumOutPipe);
 
 s32 c2h_evt_read(struct adapter *adapter, u8 *buf);
 
-- 
2.30.2


  reply	other threads:[~2022-08-06 19:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06 19:55 [PATCH 00/13] staging: r8188eu: simplify endpoint configuration Martin Kaiser
2022-08-06 19:55 ` Martin Kaiser [this message]
2022-08-06 19:55 ` [PATCH 02/13] staging: r8188eu: process HalUsbSetQueuePipeMapping8188EUsb's return value Martin Kaiser
2022-08-06 19:55 ` [PATCH 03/13] staging: r8188eu: merge two small functions Martin Kaiser
2022-08-06 19:55 ` [PATCH 04/13] staging: r8188eu: move endpoint init functions to usb_halinit.c Martin Kaiser
2022-08-06 19:55 ` [PATCH 05/13] staging: r8188eu: summarize endpoint-related settings Martin Kaiser
2022-08-06 19:55 ` [PATCH 06/13] staging: r8188eu: remove OutEpNumber Martin Kaiser
2022-08-06 19:55 ` [PATCH 07/13] staging: r8188eu: remove comments about endpoint mapping Martin Kaiser
2022-08-06 19:55 ` [PATCH 08/13] staging: r8188eu: summarize common Queue2Pipe settings Martin Kaiser
2022-08-06 19:55 ` [PATCH 09/13] staging: r8188eu: simplify three_out_pipe Martin Kaiser
2022-08-06 19:55 ` [PATCH 10/13] staging: r8188eu: simplify two_out_pipe Martin Kaiser
2022-08-06 19:55 ` [PATCH 11/13] staging: r8188eu: remove _InitNormalChipOneOutEpPriority Martin Kaiser
2022-08-06 19:55 ` [PATCH 12/13] staging: r8188eu: we always use HQ and NQ for two endpoints Martin Kaiser
2022-08-06 19:55 ` [PATCH 13/13] staging: r8188eu: simplify _InitNormalChipTwoOutEpPriority Martin Kaiser
2022-08-07  6:02 ` [PATCH 00/13] staging: r8188eu: simplify endpoint configuration Philipp Hortmann

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=20220806195540.777390-2-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /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

all inboxes | Powered by JetHome®