intr = wl1271_spi_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
        }
 
+       /* read back the status code of the command */
+       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);
+               ret = -EIO;
+       }
+
        wl1271_spi_write32(wl, ACX_REG_INTERRUPT_ACK,
                           WL1271_ACX_INTR_CMD_COMPLETE);
 
 
        if (answer) {
                struct wl1271_command *cmd_answer;
-               u16 status;
 
                /*
                 * The test command got in, we can read the answer.
                wl1271_spi_read(wl, wl->cmd_box_addr, buf, buf_len, false);
 
                cmd_answer = buf;
-               status = le16_to_cpu(cmd_answer->header.status);
-
-               if (status != CMD_STATUS_SUCCESS)
-                       wl1271_error("TEST command answer error: %d", status);
        }
 
        return 0;
        /* the interrogate command got in, we can read the answer */
        wl1271_spi_read(wl, wl->cmd_box_addr, buf, len, false);
 
-       acx = buf;
-       if (le16_to_cpu(acx->cmd.status) != CMD_STATUS_SUCCESS)
-               wl1271_error("INTERROGATE command error: %d",
-                            le16_to_cpu(acx->cmd.status));
-
 out:
        return ret;
 }
 
        /* the read command got in, we can now read the answer */
        wl1271_spi_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd), false);
-
-       if (le16_to_cpu(cmd->header.status) != CMD_STATUS_SUCCESS)
-               wl1271_error("error in read command result: %d",
-                            le16_to_cpu(cmd->header.status));
-
        memcpy(answer, cmd->value, len);
 
 out:
        ret = wl1271_cmd_send(wl, CMD_SCAN, params, sizeof(*params));
        if (ret < 0) {
                wl1271_error("SCAN failed");
-               goto out;
-       }
-
-       wl1271_spi_read(wl, wl->cmd_box_addr, params, sizeof(*params),
-                       false);
-
-       if (le16_to_cpu(params->header.status) != CMD_STATUS_SUCCESS) {
-               wl1271_error("Scan command error: %d",
-                            le16_to_cpu(params->header.status));
                wl->scanning = false;
-               ret = -EIO;
                goto out;
        }