aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorDon Fry <donald.h.fry@intel.com>2011-10-14 15:54:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-11-08 15:53:55 -0500
commitfa06ec7944897e0b9d10097e8d8b140357af1845 (patch)
treecc47e77dc3b938e56d81dd37bb4b1d8d711abb38 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent8c3d11617d61c0b69e029fd4087370bc8cb2218d (diff)
iwlagn: simplify iwl_alloc_all
The iwl_alloc_all routine is only called once. Delete the argument and print an error in the calling routine if needed. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@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.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 47dbcca56431..9d463cf40380 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3178,7 +3178,7 @@ static int iwl_set_hw_params(struct iwl_priv *priv)
3178} 3178}
3179 3179
3180/* This function both allocates and initializes hw and priv. */ 3180/* This function both allocates and initializes hw and priv. */
3181static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg) 3181static struct ieee80211_hw *iwl_alloc_all(void)
3182{ 3182{
3183 struct iwl_priv *priv; 3183 struct iwl_priv *priv;
3184 /* mac80211 allocates memory for this device instance, including 3184 /* mac80211 allocates memory for this device instance, including
@@ -3186,11 +3186,8 @@ static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg)
3186 struct ieee80211_hw *hw; 3186 struct ieee80211_hw *hw;
3187 3187
3188 hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwlagn_hw_ops); 3188 hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwlagn_hw_ops);
3189 if (hw == NULL) { 3189 if (!hw)
3190 pr_err("%s: Can not allocate network device\n",
3191 cfg->name);
3192 goto out; 3190 goto out;
3193 }
3194 3191
3195 priv = hw->priv; 3192 priv = hw->priv;
3196 priv->hw = hw; 3193 priv->hw = hw;
@@ -3211,8 +3208,9 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
3211 /************************ 3208 /************************
3212 * 1. Allocating HW data 3209 * 1. Allocating HW data
3213 ************************/ 3210 ************************/
3214 hw = iwl_alloc_all(cfg); 3211 hw = iwl_alloc_all();
3215 if (!hw) { 3212 if (!hw) {
3213 pr_err("%s: Cannot allocate network device\n", cfg->name);
3216 err = -ENOMEM; 3214 err = -ENOMEM;
3217 goto out; 3215 goto out;
3218 } 3216 }