summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-11-02 20:22:12 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-11-02 15:43:35 -0500
commitad150e966e987edcf737e1871d9e44a30d1aa58d (patch)
treeeab0be361e9a02676c032b0c1ac3a0aac203179e
parent19ad0715d8d9acc259ef02f83df767df2cf1eafe (diff)
wl1271: Correct endianness-handling of command status
Correct the endianness-handling of the firmware command result status handling code. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 46e5ea48651..8acee5cf0e6 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -48,6 +48,7 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len)
unsigned long timeout;
u32 intr;
int ret = 0;
+ u16 status;
cmd = buf;
cmd->id = cpu_to_le16(id);
@@ -78,8 +79,9 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len)
wl1271_spi_read(wl, wl->cmd_box_addr, cmd,
sizeof(struct wl1271_cmd_header), false);
- if (cmd->status != CMD_STATUS_SUCCESS) {
- wl1271_error("command execute failure %d", cmd->status);
+ status = le16_to_cpu(cmd->status);
+ if (status != CMD_STATUS_SUCCESS) {
+ wl1271_error("command execute failure %d", status);
ret = -EIO;
}