diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-03-07 13:03:59 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-03-07 13:03:59 -0500 |
commit | 1ca4d0b6b903125b86df0586e5cb3db0b6674bb7 (patch) | |
tree | 1b65774c9fd561d831707f4d7d6987d2fe5fec9d | |
parent | 80fb26863952eecef70b4e93c283d99584fbb912 (diff) |
ath6kl: fix error handling ath6kl_target_config_wlan_params()
The error handling in ath6kl_target_config_wlan_params() was just weird,
fix that. This also fixes some of the open parenthesis alignment issues
reported by checkpatch.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index d1d121dc8970..c7d514995b09 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -378,7 +378,6 @@ out: | |||
378 | 378 | ||
379 | static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx) | 379 | static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx) |
380 | { | 380 | { |
381 | int status = 0; | ||
382 | int ret; | 381 | int ret; |
383 | 382 | ||
384 | /* | 383 | /* |
@@ -386,43 +385,54 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx) | |||
386 | * default values. Required if checksum offload is needed. Set | 385 | * default values. Required if checksum offload is needed. Set |
387 | * RxMetaVersion to 2. | 386 | * RxMetaVersion to 2. |
388 | */ | 387 | */ |
389 | if (ath6kl_wmi_set_rx_frame_format_cmd(ar->wmi, idx, | 388 | ret = ath6kl_wmi_set_rx_frame_format_cmd(ar->wmi, idx, |
390 | ar->rx_meta_ver, 0, 0)) { | 389 | ar->rx_meta_ver, 0, 0); |
391 | ath6kl_err("unable to set the rx frame format\n"); | 390 | if (ret) { |
392 | status = -EIO; | 391 | ath6kl_err("unable to set the rx frame format: %d\n", ret); |
392 | return ret; | ||
393 | } | 393 | } |
394 | 394 | ||
395 | if (ar->conf_flags & ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN) | 395 | if (ar->conf_flags & ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN) { |
396 | if ((ath6kl_wmi_pmparams_cmd(ar->wmi, idx, 0, 1, 0, 0, 1, | 396 | ret = ath6kl_wmi_pmparams_cmd(ar->wmi, idx, 0, 1, 0, 0, 1, |
397 | IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN)) != 0) { | 397 | IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN); |
398 | ath6kl_err("unable to set power save fail event policy\n"); | 398 | if (ret) { |
399 | status = -EIO; | 399 | ath6kl_err("unable to set power save fail event policy: %d\n", |
400 | ret); | ||
401 | return ret; | ||
400 | } | 402 | } |
403 | } | ||
401 | 404 | ||
402 | if (!(ar->conf_flags & ATH6KL_CONF_IGNORE_ERP_BARKER)) | 405 | if (!(ar->conf_flags & ATH6KL_CONF_IGNORE_ERP_BARKER)) { |
403 | if ((ath6kl_wmi_set_lpreamble_cmd(ar->wmi, idx, 0, | 406 | ret = ath6kl_wmi_set_lpreamble_cmd(ar->wmi, idx, 0, |
404 | WMI_DONOT_IGNORE_BARKER_IN_ERP)) != 0) { | 407 | WMI_DONOT_IGNORE_BARKER_IN_ERP); |
405 | ath6kl_err("unable to set barker preamble policy\n"); | 408 | if (ret) { |
406 | status = -EIO; | 409 | ath6kl_err("unable to set barker preamble policy: %d\n", |
410 | ret); | ||
411 | return ret; | ||
407 | } | 412 | } |
413 | } | ||
408 | 414 | ||
409 | if (ath6kl_wmi_set_keepalive_cmd(ar->wmi, idx, | 415 | ret = ath6kl_wmi_set_keepalive_cmd(ar->wmi, idx, |
410 | WLAN_CONFIG_KEEP_ALIVE_INTERVAL)) { | 416 | WLAN_CONFIG_KEEP_ALIVE_INTERVAL); |
411 | ath6kl_err("unable to set keep alive interval\n"); | 417 | if (ret) { |
412 | status = -EIO; | 418 | ath6kl_err("unable to set keep alive interval: %d\n", ret); |
419 | return ret; | ||
413 | } | 420 | } |
414 | 421 | ||
415 | if (ath6kl_wmi_disctimeout_cmd(ar->wmi, idx, | 422 | ret = ath6kl_wmi_disctimeout_cmd(ar->wmi, idx, |
416 | WLAN_CONFIG_DISCONNECT_TIMEOUT)) { | 423 | WLAN_CONFIG_DISCONNECT_TIMEOUT); |
417 | ath6kl_err("unable to set disconnect timeout\n"); | 424 | if (ret) { |
418 | status = -EIO; | 425 | ath6kl_err("unable to set disconnect timeout: %d\n", ret); |
426 | return ret; | ||
419 | } | 427 | } |
420 | 428 | ||
421 | if (!(ar->conf_flags & ATH6KL_CONF_ENABLE_TX_BURST)) | 429 | if (!(ar->conf_flags & ATH6KL_CONF_ENABLE_TX_BURST)) { |
422 | if (ath6kl_wmi_set_wmm_txop(ar->wmi, idx, WMI_TXOP_DISABLED)) { | 430 | ret = ath6kl_wmi_set_wmm_txop(ar->wmi, idx, WMI_TXOP_DISABLED); |
423 | ath6kl_err("unable to set txop bursting\n"); | 431 | if (ret) { |
424 | status = -EIO; | 432 | ath6kl_err("unable to set txop bursting: %d\n", ret); |
433 | return ret; | ||
425 | } | 434 | } |
435 | } | ||
426 | 436 | ||
427 | if (ar->p2p && (ar->vif_max == 1 || idx)) { | 437 | if (ar->p2p && (ar->vif_max == 1 || idx)) { |
428 | ret = ath6kl_wmi_info_req_cmd(ar->wmi, idx, | 438 | ret = ath6kl_wmi_info_req_cmd(ar->wmi, idx, |
@@ -446,7 +456,7 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx) | |||
446 | } | 456 | } |
447 | } | 457 | } |
448 | 458 | ||
449 | return status; | 459 | return ret; |
450 | } | 460 | } |
451 | 461 | ||
452 | int ath6kl_configure_target(struct ath6kl *ar) | 462 | int ath6kl_configure_target(struct ath6kl *ar) |