Commit 0d456053 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: pass struct adapter to usb_read

The usb_read function takes a struct intf_hdl only to extract the struct
adapter from it. We can pass struct adapter directly.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230111195640.306748-18-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3f7d87d4
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
#include "../include/usb_ops.h" #include "../include/usb_ops.h"
#include "../include/rtl8188e_hal.h" #include "../include/rtl8188e_hal.h"
static int usb_read(struct intf_hdl *intf, u16 value, void *data, u8 size) static int usb_read(struct adapter *adapt, u16 value, void *data, u8 size)
{ {
struct adapter *adapt = intf->padapter;
struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt); struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
struct usb_device *udev = dvobjpriv->pusbdev; struct usb_device *udev = dvobjpriv->pusbdev;
int status; int status;
...@@ -95,20 +94,18 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size) ...@@ -95,20 +94,18 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data) int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data)
{ {
struct intf_hdl *intf = &adapter->intf;
u16 value = addr & 0xffff; u16 value = addr & 0xffff;
return usb_read(intf, value, data, 1); return usb_read(adapter, value, data, 1);
} }
int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data) int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data)
{ {
struct intf_hdl *intf = &adapter->intf;
u16 value = addr & 0xffff; u16 value = addr & 0xffff;
__le16 le_data; __le16 le_data;
int res; int res;
res = usb_read(intf, value, &le_data, 2); res = usb_read(adapter, value, &le_data, 2);
if (res) if (res)
return res; return res;
...@@ -119,12 +116,11 @@ int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data) ...@@ -119,12 +116,11 @@ int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data)
int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data) int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data)
{ {
struct intf_hdl *intf = &adapter->intf;
u16 value = addr & 0xffff; u16 value = addr & 0xffff;
__le32 le_data; __le32 le_data;
int res; int res;
res = usb_read(intf, value, &le_data, 4); res = usb_read(adapter, value, &le_data, 4);
if (res) if (res)
return res; return res;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment