2023-01-11 20:27:38

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write

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 <[email protected]>
---
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 f8900b51d750..2784fc69f7d9 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,49 +130,45 @@ 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;
int ret;

if (length > VENDOR_CMD_MAX_DATA_LEN)
return _FAIL;

- ret = usb_write(intf, value, data, length);
+ ret = usb_write(adapter, value, data, length);

return RTW_STATUS_CODE(ret);
}
--
2.30.2


2023-01-17 20:42:02

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write

On Wed, Jan 11, 2023 at 08:56:38PM +0100, Martin Kaiser wrote:
> 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 <[email protected]>
> ---
> drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)

This commit did not apply to my tree so I stopped here in the series.

Please rebase and resubmit the remaining ones.

thanks,

greg k-h