Linux wireless drivers development
 help / color / mirror / Atom feed
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Don Fry <donald.h.fry@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 4/6] iwlagn: simplify iwl_alloc_all
Date: Fri, 14 Oct 2011 12:54:46 -0700	[thread overview]
Message-ID: <1318622088-14679-5-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1318622088-14679-1-git-send-email-wey-yi.w.guy@intel.com>

From: Don Fry <donald.h.fry@intel.com>

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>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c |   10 ++++------
 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 47dbcca..9d463cf 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)
 }
 
 /* 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;
 	/* mac80211 allocates memory for this device instance, including
@@ -3186,11 +3186,8 @@ static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg)
 	struct ieee80211_hw *hw;
 
 	hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwlagn_hw_ops);
-	if (hw == NULL) {
-		pr_err("%s: Can not allocate network device\n",
-		       cfg->name);
+	if (!hw)
 		goto out;
-	}
 
 	priv = hw->priv;
 	priv->hw = hw;
@@ -3211,8 +3208,9 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
 	/************************
 	 * 1. Allocating HW data
 	 ************************/
-	hw = iwl_alloc_all(cfg);
+	hw = iwl_alloc_all();
 	if (!hw) {
+		pr_err("%s: Cannot allocate network device\n", cfg->name);
 		err = -ENOMEM;
 		goto out;
 	}
-- 
1.7.0.4


  parent reply	other threads:[~2011-10-14 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14 19:54 [PATCH 0/6] update for 3.2 Wey-Yi Guy
2011-10-14 19:54 ` [PATCH 1/6] iwlagn: update wowlan API Wey-Yi Guy
2011-10-14 19:54 ` [PATCH 2/6] iwlagn: remove unnecessary type for tracing operations Wey-Yi Guy
2011-10-14 19:54 ` [PATCH 3/6] iwlwifi: HW rev for 105 and 135 series Wey-Yi Guy
2011-10-14 19:54 ` Wey-Yi Guy [this message]
2011-10-14 19:54 ` [PATCH 5/6] iwlagn: fix the race in the unmapping of the HCMD Wey-Yi Guy
2011-10-14 19:54 ` [PATCH 6/6] iwlagn: use 6 Mbps rate for no-CCK scans Wey-Yi Guy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318622088-14679-5-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=donald.h.fry@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox