Skip to content

Commit

Permalink
Revert "mt76: usb: remove unneeded {put,get}_unaligned"
Browse files Browse the repository at this point in the history
This reverts commit f43b622.
  • Loading branch information
nbd168 committed Jul 12, 2019
1 parent 3b08966 commit 48800e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions mt76.h
Expand Up @@ -390,10 +390,7 @@ enum mt76u_out_ep {
#define MCU_RESP_URB_SIZE 1024
struct mt76_usb {
struct mutex usb_ctrl_mtx;
union {
u8 data[32];
__le32 reg_val;
};
u8 data[32];

struct tasklet_struct rx_tasklet;
struct delayed_work stat_work;
Expand Down
8 changes: 4 additions & 4 deletions usb.c
Expand Up @@ -95,9 +95,9 @@ static u32 __mt76u_rr(struct mt76_dev *dev, u32 addr)

ret = __mt76u_vendor_request(dev, req,
USB_DIR_IN | USB_TYPE_VENDOR,
0, offset, &usb->reg_val, sizeof(__le32));
0, offset, usb->data, sizeof(__le32));
if (ret == sizeof(__le32))
data = le32_to_cpu(usb->reg_val);
data = get_unaligned_le32(usb->data);
trace_usb_reg_rr(dev, addr, data);

return data;
Expand Down Expand Up @@ -131,10 +131,10 @@ static void __mt76u_wr(struct mt76_dev *dev, u32 addr, u32 val)
}
offset = addr & ~MT_VEND_TYPE_MASK;

usb->reg_val = cpu_to_le32(val);
put_unaligned_le32(val, usb->data);
__mt76u_vendor_request(dev, req,
USB_DIR_OUT | USB_TYPE_VENDOR, 0,
offset, &usb->reg_val, sizeof(__le32));
offset, usb->data, sizeof(__le32));
trace_usb_reg_wr(dev, addr, val);
}

Expand Down

0 comments on commit 48800e7

Please sign in to comment.