Commit fa06ec79 authored by Don Fry's avatar Don Fry Committed by John W. Linville

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: default avatarDon Fry <donald.h.fry@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8c3d1161
...@@ -3178,7 +3178,7 @@ static int iwl_set_hw_params(struct iwl_priv *priv) ...@@ -3178,7 +3178,7 @@ static int iwl_set_hw_params(struct iwl_priv *priv)
} }
/* This function both allocates and initializes hw and priv. */ /* This function both allocates and initializes hw and priv. */
static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg) static struct ieee80211_hw *iwl_alloc_all(void)
{ {
struct iwl_priv *priv; struct iwl_priv *priv;
/* mac80211 allocates memory for this device instance, including /* mac80211 allocates memory for this device instance, including
...@@ -3186,11 +3186,8 @@ static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg) ...@@ -3186,11 +3186,8 @@ static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg)
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwlagn_hw_ops); hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwlagn_hw_ops);
if (hw == NULL) { if (!hw)
pr_err("%s: Can not allocate network device\n",
cfg->name);
goto out; goto out;
}
priv = hw->priv; priv = hw->priv;
priv->hw = hw; priv->hw = hw;
...@@ -3211,8 +3208,9 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, ...@@ -3211,8 +3208,9 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
/************************ /************************
* 1. Allocating HW data * 1. Allocating HW data
************************/ ************************/
hw = iwl_alloc_all(cfg); hw = iwl_alloc_all();
if (!hw) { if (!hw) {
pr_err("%s: Cannot allocate network device\n", cfg->name);
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment