aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-08-21 16:34:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:37 -0400
commit5eadd94bd4006aacf12052c447bcc997bf6ecd28 (patch)
tree5998d219547e16445e8eb78300de14fceeb341a6 /drivers/net/wireless/iwlwifi/iwl-agn.c
parentdc1b09733215e19f6a0f676be2744fe2f5471d85 (diff)
iwlwifi: error checking for setting tx_power in sysfs
Perform error checking and report failure when setting tx power from sysfs. If fail to set the tx power, do not update the local copy, so user will not see the incorrect tx power in sysfs Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 2232b1794e76..533b393e8cf6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2477,10 +2477,15 @@ static ssize_t store_tx_power(struct device *d,
2477 ret = strict_strtoul(buf, 10, &val); 2477 ret = strict_strtoul(buf, 10, &val);
2478 if (ret) 2478 if (ret)
2479 IWL_INFO(priv, "%s is not in decimal form.\n", buf); 2479 IWL_INFO(priv, "%s is not in decimal form.\n", buf);
2480 else 2480 else {
2481 iwl_set_tx_power(priv, val, false); 2481 ret = iwl_set_tx_power(priv, val, false);
2482 2482 if (ret)
2483 return count; 2483 IWL_ERR(priv, "failed setting tx power (0x%d).\n",
2484 ret);
2485 else
2486 ret = count;
2487 }
2488 return ret;
2484} 2489}
2485 2490
2486static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); 2491static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);