mt76: usb: fix endian in mt76u_copy
authorStanislaw Gruszka <sgruszka@redhat.com>
Tue, 9 Jul 2019 15:14:54 +0000 (17:14 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Sep 2019 15:42:29 +0000 (17:42 +0200)
In contrast to mt76_wr() which we use to program registers,
on mt76_wr_copy() we should not change endian of the data.

Fixes: b40b15e1521f ("mt76: add usb support to mt76 layer")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/usb.c

index 4a0d841a3e6aa947f525398dad3f08ca61f2d1be..f19bd60588effa7b14488a689a9a21f609cbfc44 100644 (file)
@@ -165,11 +165,11 @@ static void mt76u_copy(struct mt76_dev *dev, u32 offset,
 
        mutex_lock(&usb->usb_ctrl_mtx);
        for (i = 0; i < DIV_ROUND_UP(len, 4); i++) {
-               put_unaligned_le32(val[i], usb->data);
+               put_unaligned(val[i], (u32 *) usb->data);
                ret = __mt76u_vendor_request(dev, MT_VEND_MULTI_WRITE,
                                             USB_DIR_OUT | USB_TYPE_VENDOR,
                                             0, offset + i * 4, usb->data,
-                                            sizeof(__le32));
+                                            sizeof(u32));
                if (ret < 0)
                        break;
        }