diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2009-11-19 10:29:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-19 10:29:57 +0300 |
commit | 0e4817470be8d233fb58b5af7b938185dae94d67 (patch) | |
tree | 64b3d707b1f8b2225e59bf731bf9f54304215d33 /drivers/misc/iwmc3200top/fw-download.c | |
parent | a0607fd3a25ba1848a63a0d925e36d914735ab47 (diff) | |
download | linux-0e4817470be8d233fb58b5af7b938185dae94d67.tar.xz |
iwmc3200top: revamp fw name handling
1. define macro for handling firmware api version
2. add MODULE_FIRMWARE
3. cleanup iwmct_fw_load style
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/misc/iwmc3200top/fw-download.c')
-rw-r--r-- | drivers/misc/iwmc3200top/fw-download.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/misc/iwmc3200top/fw-download.c b/drivers/misc/iwmc3200top/fw-download.c index 33cb693dd37c..50d431e469f5 100644 --- a/drivers/misc/iwmc3200top/fw-download.c +++ b/drivers/misc/iwmc3200top/fw-download.c @@ -291,35 +291,31 @@ static int iwmct_kick_fw(struct iwmct_priv *priv, bool jump) int iwmct_fw_load(struct iwmct_priv *priv) { - const struct firmware *raw = NULL; - __le32 addr; - size_t len; + const u8 *fw_name = FW_NAME(FW_API_VER); + const struct firmware *raw; const u8 *pdata; - const u8 *name = "iwmc3200top.1.fw"; - int ret = 0; + size_t len; + __le32 addr; + int ret; /* clear parser struct */ memset(&priv->parser, 0, sizeof(struct iwmct_parser)); - if (!name) { - ret = -EINVAL; - goto exit; - } /* get the firmware */ - ret = request_firmware(&raw, name, &priv->func->dev); + ret = request_firmware(&raw, fw_name, &priv->func->dev); if (ret < 0) { LOG_ERROR(priv, FW_DOWNLOAD, "%s request_firmware failed %d\n", - name, ret); + fw_name, ret); goto exit; } if (raw->size < sizeof(struct iwmct_fw_sec_hdr)) { LOG_ERROR(priv, FW_DOWNLOAD, "%s smaller then (%zd) (%zd)\n", - name, sizeof(struct iwmct_fw_sec_hdr), raw->size); + fw_name, sizeof(struct iwmct_fw_sec_hdr), raw->size); goto exit; } - LOG_INFO(priv, FW_DOWNLOAD, "Read firmware '%s'\n", name); + LOG_INFO(priv, FW_DOWNLOAD, "Read firmware '%s'\n", fw_name); ret = iwmct_fw_parser_init(priv, raw->data, raw->size, priv->trans_len); if (ret < 0) { @@ -339,7 +335,7 @@ int iwmct_fw_load(struct iwmct_priv *priv) while (iwmct_parse_next_section(priv, &pdata, &len, &addr)) { if (iwmct_download_section(priv, pdata, len, addr)) { LOG_ERROR(priv, FW_DOWNLOAD, - "%s download section failed\n", name); + "%s download section failed\n", fw_name); ret = -EIO; goto exit; } |