diff options
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) | |||
291 | 291 | ||
292 | int iwmct_fw_load(struct iwmct_priv *priv) | 292 | int iwmct_fw_load(struct iwmct_priv *priv) |
293 | { | 293 | { |
294 | const struct firmware *raw = NULL; | 294 | const u8 *fw_name = FW_NAME(FW_API_VER); |
295 | __le32 addr; | 295 | const struct firmware *raw; |
296 | size_t len; | ||
297 | const u8 *pdata; | 296 | const u8 *pdata; |
298 | const u8 *name = "iwmc3200top.1.fw"; | 297 | size_t len; |
299 | int ret = 0; | 298 | __le32 addr; |
299 | int ret; | ||
300 | 300 | ||
301 | /* clear parser struct */ | 301 | /* clear parser struct */ |
302 | memset(&priv->parser, 0, sizeof(struct iwmct_parser)); | 302 | memset(&priv->parser, 0, sizeof(struct iwmct_parser)); |
303 | if (!name) { | ||
304 | ret = -EINVAL; | ||
305 | goto exit; | ||
306 | } | ||
307 | 303 | ||
308 | /* get the firmware */ | 304 | /* get the firmware */ |
309 | ret = request_firmware(&raw, name, &priv->func->dev); | 305 | ret = request_firmware(&raw, fw_name, &priv->func->dev); |
310 | if (ret < 0) { | 306 | if (ret < 0) { |
311 | LOG_ERROR(priv, FW_DOWNLOAD, "%s request_firmware failed %d\n", | 307 | LOG_ERROR(priv, FW_DOWNLOAD, "%s request_firmware failed %d\n", |
312 | name, ret); | 308 | fw_name, ret); |
313 | goto exit; | 309 | goto exit; |
314 | } | 310 | } |
315 | 311 | ||
316 | if (raw->size < sizeof(struct iwmct_fw_sec_hdr)) { | 312 | if (raw->size < sizeof(struct iwmct_fw_sec_hdr)) { |
317 | LOG_ERROR(priv, FW_DOWNLOAD, "%s smaller then (%zd) (%zd)\n", | 313 | LOG_ERROR(priv, FW_DOWNLOAD, "%s smaller then (%zd) (%zd)\n", |
318 | name, sizeof(struct iwmct_fw_sec_hdr), raw->size); | 314 | fw_name, sizeof(struct iwmct_fw_sec_hdr), raw->size); |
319 | goto exit; | 315 | goto exit; |
320 | } | 316 | } |
321 | 317 | ||
322 | LOG_INFO(priv, FW_DOWNLOAD, "Read firmware '%s'\n", name); | 318 | LOG_INFO(priv, FW_DOWNLOAD, "Read firmware '%s'\n", fw_name); |
323 | 319 | ||
324 | ret = iwmct_fw_parser_init(priv, raw->data, raw->size, priv->trans_len); | 320 | ret = iwmct_fw_parser_init(priv, raw->data, raw->size, priv->trans_len); |
325 | if (ret < 0) { | 321 | if (ret < 0) { |
@@ -339,7 +335,7 @@ int iwmct_fw_load(struct iwmct_priv *priv) | |||
339 | while (iwmct_parse_next_section(priv, &pdata, &len, &addr)) { | 335 | while (iwmct_parse_next_section(priv, &pdata, &len, &addr)) { |
340 | if (iwmct_download_section(priv, pdata, len, addr)) { | 336 | if (iwmct_download_section(priv, pdata, len, addr)) { |
341 | LOG_ERROR(priv, FW_DOWNLOAD, | 337 | LOG_ERROR(priv, FW_DOWNLOAD, |
342 | "%s download section failed\n", name); | 338 | "%s download section failed\n", fw_name); |
343 | ret = -EIO; | 339 | ret = -EIO; |
344 | goto exit; | 340 | goto exit; |
345 | } | 341 | } |