diff options
author | Johannes Berg <johannes.berg@intel.com> | 2024-02-28 12:11:56 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2024-03-05 20:54:15 +0200 |
commit | 81e060584f1deb7f89df5c0b7897a96409cf6c2a (patch) | |
tree | 729a63c3d600376e61927a3bec76cff96f335f31 /drivers/net/wireless/st | |
parent | f6e36d9e1c6353b74f1511ea18aa7c6fddd6e697 (diff) |
wifi: cw1200: restore endian swapping
The code here looks well thought-out, so it seems likely
that the byte-swaps are actually needed, due to SPI bus
and device behaviour. Restore the byte-swapping, in a way
that doesn't result in sparse warnings.
Fixes: 7ceade653429 ("wifi: cw1200: fix __le16 sparse warnings")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240228121156.62f820aa6dfb.Ia63314e4d0ed1ee76f100846d68f0722abf6b793@changeid
Diffstat (limited to 'drivers/net/wireless/st')
-rw-r--r-- | drivers/net/wireless/st/cw1200/cw1200_spi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/st/cw1200/cw1200_spi.c b/drivers/net/wireless/st/cw1200/cw1200_spi.c index fb3aafcafe18..4f346fb977a9 100644 --- a/drivers/net/wireless/st/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c @@ -81,6 +81,9 @@ static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self, pr_info("READ : %04d from 0x%02x (%04x)\n", count, addr, regaddr); #endif + /* Header is LE16 */ + regaddr = (__force u16)cpu_to_le16(regaddr); + /* We have to byteswap if the SPI bus is limited to 8b operation or we are running on a Big Endian system */ @@ -143,6 +146,9 @@ static int cw1200_spi_memcpy_toio(struct hwbus_priv *self, pr_info("WRITE: %04d to 0x%02x (%04x)\n", count, addr, regaddr); #endif + /* Header is LE16 */ + regaddr = (__force u16)cpu_to_le16(regaddr); + /* We have to byteswap if the SPI bus is limited to 8b operation or we are running on a Big Endian system */ |