Commit d217e5dd authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman

staging: rtl8723au: Move data byte-swap closer to register access

This makes sparse happy
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b35c0ff6
......@@ -53,22 +53,16 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr)
u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr)
{
u16 r_val;
struct _io_ops *io_ops = &adapter->io_ops;
r_val = io_ops->_read16(adapter, addr);
return le16_to_cpu(r_val);
return io_ops->_read16(adapter, addr);
}
u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr)
{
u32 r_val;
struct _io_ops *io_ops = &adapter->io_ops;
r_val = io_ops->_read32(adapter, addr);
return le32_to_cpu(r_val);
return io_ops->_read32(adapter, addr);
}
int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val)
......@@ -86,7 +80,6 @@ int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val)
struct _io_ops *io_ops = &adapter->io_ops;
int ret;
val = cpu_to_le16(val);
ret = io_ops->_write16(adapter, addr, val);
return RTW_STATUS_CODE23a(ret);
......@@ -97,7 +90,6 @@ int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val)
struct _io_ops *io_ops = &adapter->io_ops;
int ret;
val = cpu_to_le32(val);
ret = io_ops->_write32(adapter, addr, val);
return RTW_STATUS_CODE23a(ret);
......
......@@ -154,7 +154,7 @@ static u16 usb_read16(struct rtw_adapter *padapter, u32 addr)
u16 wvalue;
u16 index;
u16 len;
u16 data = 0;
__le16 data;
request = 0x05;
requesttype = 0x01;/* read_in */
......@@ -166,7 +166,7 @@ static u16 usb_read16(struct rtw_adapter *padapter, u32 addr)
usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);
return data;
return le16_to_cpu(data);
}
static u32 usb_read32(struct rtw_adapter *padapter, u32 addr)
......@@ -176,7 +176,7 @@ static u32 usb_read32(struct rtw_adapter *padapter, u32 addr)
u16 wvalue;
u16 index;
u16 len;
u32 data = 0;
__le32 data;
request = 0x05;
requesttype = 0x01;/* read_in */
......@@ -188,7 +188,7 @@ static u32 usb_read32(struct rtw_adapter *padapter, u32 addr)
usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);
return data;
return le32_to_cpu(data);
}
static int usb_write8(struct rtw_adapter *padapter, u32 addr, u8 val)
......@@ -223,7 +223,7 @@ static int usb_write16(struct rtw_adapter *padapter, u32 addr, u16 val)
u16 wvalue;
u16 index;
u16 len;
u16 data;
__le16 data;
int ret;
request = 0x05;
......@@ -233,7 +233,7 @@ static int usb_write16(struct rtw_adapter *padapter, u32 addr, u16 val)
wvalue = (u16)(addr&0x0000ffff);
len = 2;
data = val;
data = cpu_to_le16(val);
ret = usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);
......@@ -247,7 +247,7 @@ static int usb_write32(struct rtw_adapter *padapter, u32 addr, u32 val)
u16 wvalue;
u16 index;
u16 len;
u32 data;
__le32 data;
int ret;
request = 0x05;
......@@ -256,7 +256,7 @@ static int usb_write32(struct rtw_adapter *padapter, u32 addr, u32 val)
wvalue = (u16)(addr&0x0000ffff);
len = 4;
data = val;
data = cpu_to_le32(val);
ret = usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);
......
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