Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183237
b: refs/heads/master
c: 9fa4d67
h: refs/heads/master
i:
  183235: 7184a60
v: v3
  • Loading branch information
Tomas Winkler authored and David S. Miller committed Dec 23, 2009
1 parent 4b44ce2 commit 136dfe7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31d12926e37291970dd4f6e9940df3897766a81d
refs/heads/master: 9fa4d67c6e4d678271798f006ca1d945e8b2bd5c
20 changes: 6 additions & 14 deletions trunk/drivers/misc/iwmc3200top/fw-download.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ static int iwmct_fw_parser_init(struct iwmct_priv *priv, const u8 *file,
parser->file = file;
parser->file_size = file_size;
parser->cur_pos = 0;
parser->buf = NULL;

parser->entry_point = 0;
parser->buf = kzalloc(block_size, GFP_KERNEL);
if (!parser->buf) {
LOG_ERROR(priv, FW_DOWNLOAD, "kzalloc error\n");
Expand Down Expand Up @@ -298,8 +297,6 @@ int iwmct_fw_load(struct iwmct_priv *priv)
__le32 addr;
int ret;

/* clear parser struct */
memset(&priv->parser, 0, sizeof(struct iwmct_parser));

/* get the firmware */
ret = request_firmware(&raw, fw_name, &priv->func->dev);
Expand All @@ -317,14 +314,14 @@ int iwmct_fw_load(struct iwmct_priv *priv)

LOG_INFO(priv, FW_DOWNLOAD, "Read firmware '%s'\n", fw_name);

/* clear parser struct */
ret = iwmct_fw_parser_init(priv, raw->data, raw->size, priv->trans_len);
if (ret < 0) {
LOG_ERROR(priv, FW_DOWNLOAD,
"iwmct_parser_init failed: Reason %d\n", ret);
goto exit;
}

/* checksum */
if (!iwmct_checksum(priv)) {
LOG_ERROR(priv, FW_DOWNLOAD, "checksum error\n");
ret = -EINVAL;
Expand All @@ -333,23 +330,18 @@ int iwmct_fw_load(struct iwmct_priv *priv)

/* download firmware to device */
while (iwmct_parse_next_section(priv, &pdata, &len, &addr)) {
if (iwmct_download_section(priv, pdata, len, addr)) {
ret = iwmct_download_section(priv, pdata, len, addr);
if (ret) {
LOG_ERROR(priv, FW_DOWNLOAD,
"%s download section failed\n", fw_name);
ret = -EIO;
goto exit;
}
}

iwmct_kick_fw(priv, !!(priv->barker & BARKER_DNLOAD_JUMP_MSK));
ret = iwmct_kick_fw(priv, !!(priv->barker & BARKER_DNLOAD_JUMP_MSK));

exit:
kfree(priv->parser.buf);

if (raw)
release_firmware(raw);

raw = NULL;

release_firmware(raw);
return ret;
}

0 comments on commit 136dfe7

Please sign in to comment.