Commit 81e06058 authored by Johannes Berg's avatar Johannes Berg Committed by Kalle Valo

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: 7ceade65 ("wifi: cw1200: fix __le16 sparse warnings")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240228121156.62f820aa6dfb.Ia63314e4d0ed1ee76f100846d68f0722abf6b793@changeid
parent f6e36d9e
...@@ -81,6 +81,9 @@ static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self, ...@@ -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); pr_info("READ : %04d from 0x%02x (%04x)\n", count, addr, regaddr);
#endif #endif
/* Header is LE16 */
regaddr = (__force u16)cpu_to_le16(regaddr);
/* We have to byteswap if the SPI bus is limited to 8b operation /* We have to byteswap if the SPI bus is limited to 8b operation
or we are running on a Big Endian system or we are running on a Big Endian system
*/ */
...@@ -143,6 +146,9 @@ static int cw1200_spi_memcpy_toio(struct hwbus_priv *self, ...@@ -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); pr_info("WRITE: %04d to 0x%02x (%04x)\n", count, addr, regaddr);
#endif #endif
/* Header is LE16 */
regaddr = (__force u16)cpu_to_le16(regaddr);
/* We have to byteswap if the SPI bus is limited to 8b operation /* We have to byteswap if the SPI bus is limited to 8b operation
or we are running on a Big Endian system or we are running on a Big Endian system
*/ */
......
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