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 02/23] staging: r8188eu: pass struct adapter to usb_write
Date: Mon, 23 Jan 2023 21:53:21 +0100 [thread overview]
Message-ID: <20230123205342.229589-3-martin@kaiser.cx> (raw)
In-Reply-To: <20230123205342.229589-1-martin@kaiser.cx>
The usb_write function takes a struct intf_hdl only to extract the struct
adapter from it. We can pass struct adapter directly.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index d82abfcd91f3..9f008e61a6f2 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -49,9 +49,8 @@ static int usb_read(struct adapter *adapt, u16 value, void *data, u8 size)
return status;
}
-static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
+static int usb_write(struct adapter *adapt, u16 value, void *data, u8 size)
{
- struct adapter *adapt = intf->padapter;
struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
struct usb_device *udev = dvobjpriv->pusbdev;
int status;
@@ -131,48 +130,44 @@ int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data)
int rtw_write8(struct adapter *adapter, u32 addr, u8 val)
{
- struct intf_hdl *intf = &adapter->intf;
u16 value = addr & 0xffff;
int ret;
- ret = usb_write(intf, value, &val, 1);
+ ret = usb_write(adapter, value, &val, 1);
return RTW_STATUS_CODE(ret);
}
int rtw_write16(struct adapter *adapter, u32 addr, u16 val)
{
- struct intf_hdl *intf = &adapter->intf;
u16 value = addr & 0xffff;
__le16 data = cpu_to_le16(val);
int ret;
- ret = usb_write(intf, value, &data, 2);
+ ret = usb_write(adapter, value, &data, 2);
return RTW_STATUS_CODE(ret);
}
int rtw_write32(struct adapter *adapter, u32 addr, u32 val)
{
- struct intf_hdl *intf = &adapter->intf;
u16 value = addr & 0xffff;
__le32 data = cpu_to_le32(val);
int ret;
- ret = usb_write(intf, value, &data, 4);
+ ret = usb_write(adapter, value, &data, 4);
return RTW_STATUS_CODE(ret);
}
int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)
{
- struct intf_hdl *intf = &adapter->intf;
u16 value = addr & 0xffff;
if (length > VENDOR_CMD_MAX_DATA_LEN)
return -EINVAL;
- return usb_write(intf, value, data, length);
+ return usb_write(adapter, value, data, length);
}
static void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf)
--
2.30.2
next prev parent reply other threads:[~2023-01-23 20:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 20:53 [PATCH 00/23] staging: r8188eu: some more xmit cleanups Martin Kaiser
2023-01-23 20:53 ` [PATCH 01/23] staging: r8188eu: we use a constant number of hw_xmit entries Martin Kaiser
2023-01-23 20:53 ` Martin Kaiser [this message]
2023-01-23 20:53 ` [PATCH 03/23] staging: r8188eu: remove struct intf_hdl Martin Kaiser
2023-01-23 20:53 ` [PATCH 04/23] staging: r8188eu: remove struct intf_priv Martin Kaiser
2023-01-23 20:53 ` [PATCH 05/23] staging: r8188eu: simplify the sta loop in rtw_dequeue_xframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 06/23] staging: r8188eu: simplify the code to initialise inx Martin Kaiser
2023-01-23 20:53 ` [PATCH 07/23] staging: r8188eu: remove an obsolete comment Martin Kaiser
2023-01-23 20:53 ` [PATCH 08/23] staging: r8188eu: remove unused function parameter Martin Kaiser
2023-01-23 20:53 ` [PATCH 09/23] staging: r8188eu: remove dead assignment Martin Kaiser
2023-01-23 20:53 ` [PATCH 10/23] staging: r8188eu: use list_empty Martin Kaiser
2023-01-23 20:53 ` [PATCH 11/23] staging: r8188eu: simplify dequeue_one_xmitframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 12/23] staging: r8188eu: remove redundant parameter Martin Kaiser
2023-01-23 20:53 ` [PATCH 13/23] staging: r8188eu: make rtw_chk_hi_queue_cmd a void function Martin Kaiser
2023-01-23 20:53 ` [PATCH 14/23] staging: r8188eu: decrement qcnt in rtw_dequeue_xframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 15/23] staging: r8188eu: simplify dequeue_one_xmitframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 16/23] staging: r8188eu: use list_head for xmitframe list Martin Kaiser
2023-01-23 20:53 ` [PATCH 17/23] staging: r8188eu: merge dequeue_one_xmitframe into its caller Martin Kaiser
2023-01-23 20:53 ` [PATCH 18/23] staging: r8188eu: use lists for hwxmits Martin Kaiser
2023-01-23 20:53 ` [PATCH 19/23] staging: r8188eu: fix rtw_xmitframe_enqueue error handling Martin Kaiser
2023-01-23 20:53 ` [PATCH 20/23] staging: r8188eu: remove rtw_xmitframe_enqueue Martin Kaiser
2023-01-23 20:53 ` [PATCH 21/23] staging: r8188eu: struct agg_pkt_info is unused Martin Kaiser
2023-01-23 20:53 ` [PATCH 22/23] staging: r8188eu: apsd_setting " Martin Kaiser
2023-01-23 20:53 ` [PATCH 23/23] staging: r8188eu: merge rtw_free_hwxmits into its only caller Martin Kaiser
2023-01-24 19:01 ` [PATCH 00/23] staging: r8188eu: some more xmit cleanups 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=20230123205342.229589-3-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®