diff options
Diffstat (limited to 'drivers/net/wimax')
-rw-r--r-- | drivers/net/wimax/i2400m/fw.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c index 798564eb0e99..55fe011a9633 100644 --- a/drivers/net/wimax/i2400m/fw.c +++ b/drivers/net/wimax/i2400m/fw.c | |||
@@ -1288,7 +1288,7 @@ error_dev_rebooted: | |||
1288 | */ | 1288 | */ |
1289 | int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags) | 1289 | int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags) |
1290 | { | 1290 | { |
1291 | int ret = 0, itr = 0; | 1291 | int ret, itr; |
1292 | struct device *dev = i2400m_dev(i2400m); | 1292 | struct device *dev = i2400m_dev(i2400m); |
1293 | const struct firmware *fw; | 1293 | const struct firmware *fw; |
1294 | const struct i2400m_bcf_hdr *bcf; /* Firmware data */ | 1294 | const struct i2400m_bcf_hdr *bcf; /* Firmware data */ |
@@ -1297,32 +1297,31 @@ int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags) | |||
1297 | d_fnstart(5, dev, "(i2400m %p)\n", i2400m); | 1297 | d_fnstart(5, dev, "(i2400m %p)\n", i2400m); |
1298 | 1298 | ||
1299 | /* Load firmware files to memory. */ | 1299 | /* Load firmware files to memory. */ |
1300 | itr = 0; | 1300 | for (itr = 0, bcf = NULL, ret = -ENOENT; ; itr++) { |
1301 | while(1) { | ||
1302 | fw_name = i2400m->bus_fw_names[itr]; | 1301 | fw_name = i2400m->bus_fw_names[itr]; |
1303 | if (fw_name == NULL) { | 1302 | if (fw_name == NULL) { |
1304 | dev_err(dev, "Could not find a usable firmware image\n"); | 1303 | dev_err(dev, "Could not find a usable firmware image\n"); |
1305 | ret = -ENOENT; | 1304 | ret = -ENOENT; |
1306 | goto error_no_fw; | 1305 | break; |
1307 | } | 1306 | } |
1307 | d_printf(1, dev, "trying firmware %s (%d)\n", fw_name, itr); | ||
1308 | ret = request_firmware(&fw, fw_name, dev); | 1308 | ret = request_firmware(&fw, fw_name, dev); |
1309 | if (ret == 0) | 1309 | if (ret < 0) { |
1310 | break; /* got it */ | ||
1311 | if (ret < 0) | ||
1312 | dev_err(dev, "fw %s: cannot load file: %d\n", | 1310 | dev_err(dev, "fw %s: cannot load file: %d\n", |
1313 | fw_name, ret); | 1311 | fw_name, ret); |
1314 | itr++; | 1312 | continue; |
1313 | } | ||
1314 | bcf = (void *) fw->data; | ||
1315 | i2400m->fw_name = fw_name; | ||
1316 | ret = i2400m_fw_check(i2400m, bcf, fw->size); | ||
1317 | if (ret >= 0) { | ||
1318 | ret = i2400m_fw_dnload(i2400m, bcf, fw->size, flags); | ||
1319 | if (ret >= 0) | ||
1320 | break; | ||
1321 | } else | ||
1322 | dev_err(dev, "%s: cannot use, skipping\n", fw_name); | ||
1323 | release_firmware(fw); | ||
1315 | } | 1324 | } |
1316 | |||
1317 | bcf = (void *) fw->data; | ||
1318 | i2400m->fw_name = fw_name; | ||
1319 | ret = i2400m_fw_check(i2400m, bcf, fw->size); | ||
1320 | if (ret < 0) | ||
1321 | goto error_fw_bad; | ||
1322 | ret = i2400m_fw_dnload(i2400m, bcf, fw->size, flags); | ||
1323 | error_fw_bad: | ||
1324 | release_firmware(fw); | ||
1325 | error_no_fw: | ||
1326 | d_fnend(5, dev, "(i2400m %p) = %d\n", i2400m, ret); | 1325 | d_fnend(5, dev, "(i2400m %p) = %d\n", i2400m, ret); |
1327 | return ret; | 1326 | return ret; |
1328 | } | 1327 | } |