linux-wireless.vger.kernel.org archive mirror
 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,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 09/28] iwlwifi: remove the pointer to dev from the bus layer
Date: Thu,  2 Feb 2012 15:09:00 -0800	[thread overview]
Message-ID: <1328224159-18134-10-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1328224159-18134-1-git-send-email-wey-yi.w.guy@intel.com>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c   |    4 ++--
 drivers/net/wireless/iwlwifi/iwl-bus.h   |    2 --
 drivers/net/wireless/iwlwifi/iwl-debug.h |   16 ++++++++--------
 drivers/net/wireless/iwlwifi/iwl-pci.c   |    7 ++++---
 drivers/net/wireless/iwlwifi/iwl-ucode.c |    4 ++--
 5 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f797915..d890b64 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1146,7 +1146,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
 	iwl_dealloc_ucode(trans(priv));
  out_unbind:
 	complete(&priv->firmware_loading_complete);
-	device_release_driver(bus(priv)->dev);
+	device_release_driver(trans(priv)->dev);
 	release_firmware(ucode_raw);
 }
 
@@ -1785,7 +1785,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
 
 	/* At this point both hw and priv are allocated. */
 
-	SET_IEEE80211_DEV(hw, bus(priv)->dev);
+	SET_IEEE80211_DEV(hw, trans(priv)->dev);
 
 	/* what debugging capabilities we have */
 	iwl_debug_config(priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-bus.h b/drivers/net/wireless/iwlwifi/iwl-bus.h
index ce1a9cc..2065c5b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-bus.h
+++ b/drivers/net/wireless/iwlwifi/iwl-bus.h
@@ -137,14 +137,12 @@ struct iwl_bus_ops {
  *
  * This data is common to all bus layer implementations.
  *
- * @dev - pointer to struct device * that represents the device
  * @ops - pointer to iwl_bus_ops
  * @shrd - pointer to iwl_shared which holds shared data from the upper layer
  *	NB: for the time being this needs to be set by the upper layer since
  *	it allocates the shared data
  */
 struct iwl_bus {
-	struct device *dev;
 	const struct iwl_bus_ops *ops;
 	struct iwl_shared *shrd;
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 6f76127..351b41d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -35,10 +35,10 @@
 struct iwl_priv;
 
 /*No matter what is m (priv, bus, trans), this will work */
-#define IWL_ERR(m, f, a...) dev_err(bus(m)->dev, f, ## a)
-#define IWL_WARN(m, f, a...) dev_warn(bus(m)->dev, f, ## a)
-#define IWL_INFO(m, f, a...) dev_info(bus(m)->dev, f, ## a)
-#define IWL_CRIT(m, f, a...) dev_crit(bus(m)->dev, f, ## a)
+#define IWL_ERR(m, f, a...) dev_err(trans(m)->dev, f, ## a)
+#define IWL_WARN(m, f, a...) dev_warn(trans(m)->dev, f, ## a)
+#define IWL_INFO(m, f, a...) dev_info(trans(m)->dev, f, ## a)
+#define IWL_CRIT(m, f, a...) dev_crit(trans(m)->dev, f, ## a)
 
 #define iwl_print_hex_error(m, p, len)					\
 do {									\
@@ -50,7 +50,7 @@ do {									\
 #define IWL_DEBUG(m, level, fmt, ...)					\
 do {									\
 	if (iwl_get_debug_level((m)->shrd) & (level))			\
-		dev_err(bus(m)->dev, "%c %s " fmt,			\
+		dev_err(trans(m)->dev, "%c %s " fmt,			\
 			in_interrupt() ? 'I' : 'U', __func__,		\
 			##__VA_ARGS__);					\
 } while (0)
@@ -59,7 +59,7 @@ do {									\
 do {									\
 	if (iwl_get_debug_level((m)->shrd) & (level) &&			\
 	    net_ratelimit())						\
-		dev_err(bus(m)->dev, "%c %s " fmt,			\
+		dev_err(trans(m)->dev, "%c %s " fmt,			\
 			in_interrupt() ? 'I' : 'U', __func__,		\
 			##__VA_ARGS__);					\
 } while (0)
@@ -74,12 +74,12 @@ do {                                            			\
 #define IWL_DEBUG_QUIET_RFKILL(p, fmt, ...)				\
 do {									\
 	if (!iwl_is_rfkill(p->shrd))					\
-		dev_err(bus(p)->dev, "%s%c %s " fmt,			\
+		dev_err(trans(p)->dev, "%s%c %s " fmt,			\
 			"",						\
 			in_interrupt() ? 'I' : 'U', __func__,		\
 			##__VA_ARGS__);					\
 	else if	(iwl_get_debug_level(p->shrd) & IWL_DL_RADIO)		\
-		dev_err(bus(p)->dev, "%s%c %s " fmt,			\
+		dev_err(trans(p)->dev, "%s%c %s " fmt,			\
 			"(RFKILL) ",					\
 			in_interrupt() ? 'I' : 'U', __func__,		\
 			##__VA_ARGS__);					\
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 7bab819..6451739 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -123,12 +123,14 @@ static void iwl_pci_apm_config(struct iwl_bus *bus)
 		/* L1-ASPM enabled; disable(!) L0S */
 		iwl_set_bit(trans(bus), CSR_GIO_REG,
 				CSR_GIO_REG_VAL_L0S_ENABLED);
-		dev_printk(KERN_INFO, bus->dev, "L1 Enabled; Disabling L0S\n");
+		dev_printk(KERN_INFO, trans(bus)->dev,
+			   "L1 Enabled; Disabling L0S\n");
 	} else {
 		/* L1-ASPM disabled; enable(!) L0S */
 		iwl_clear_bit(trans(bus), CSR_GIO_REG,
 				CSR_GIO_REG_VAL_L0S_ENABLED);
-		dev_printk(KERN_INFO, bus->dev, "L1 Disabled; Enabling L0S\n");
+		dev_printk(KERN_INFO, trans(bus)->dev,
+			   "L1 Disabled; Enabling L0S\n");
 	}
 }
 
@@ -368,7 +370,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_set_drvdata(pdev, bus);
 
-	bus->dev = &pdev->dev;
 	bus->ops = &bus_ops_pci;
 
 #ifdef CONFIG_IWLWIFI_IDI
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 5de8b5b..08483d7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -83,7 +83,7 @@ static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = {
 static void iwl_free_fw_desc(struct iwl_bus *bus, struct fw_desc *desc)
 {
 	if (desc->v_addr)
-		dma_free_coherent(bus->dev, desc->len,
+		dma_free_coherent(trans(bus)->dev, desc->len,
 				  desc->v_addr, desc->p_addr);
 	desc->v_addr = NULL;
 	desc->len = 0;
@@ -110,7 +110,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc,
 		return -EINVAL;
 	}
 
-	desc->v_addr = dma_alloc_coherent(bus->dev, len,
+	desc->v_addr = dma_alloc_coherent(trans(bus)->dev, len,
 					  &desc->p_addr, GFP_KERNEL);
 	if (!desc->v_addr)
 		return -ENOMEM;
-- 
1.7.0.4


  parent reply	other threads:[~2012-02-03  0:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 23:08 [PATCH 00/28] update for 3.4: iwlwifi 2012-02-02 Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 01/28] iwlwifi: add fw_alive to transport layer API, kill tx_start Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 02/28] iwlwifi: Connect IDI transport to driver Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 03/28] iwlwifi: separate the APM from the EEPROM Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 04/28] iwlwifi: move the shrd memory from priv Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 05/28] iwlwifi: allocate the transport from the bus layer Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 06/28] iwlwifi: move the bus configuration to transport Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 07/28] iwlwifi: the read / write register ops move " Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 08/28] iwlwifi: give trans to all the read / write functions Wey-Yi Guy
2012-02-02 23:09 ` Wey-Yi Guy [this message]
2012-02-02 23:09 ` [PATCH 10/28] iwlwifi: don't use the bus for ucode fw_desc any more Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 11/28] iwlwifi: rename trans_ops->request_irq to trans_ops->start_hw Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 12/28] iwlwifi: move prepare_card_hw to start_hw Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 13/28] iwlwifi: move apm_init " Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 14/28] iwlwifi: introduce trans_ops->stop_hw Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 15/28] iwlwifi: move the RF kill logic from iwl_probe to transport Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 16/28] iwlwifi: consolidate the start_device flow Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 17/28] iwlwifi: kill bus_apm_config Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 18/28] iwlwifi: kill bus_is_pm_supported Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 19/28] iwlwifi: kill bus_get_hw_id_string Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 20/28] iwlwifi: kill bus_get_hw_id Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 21/28] iwlwifi: move hw_rev to transport layer Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 22/28] iwlwifi: stop_hw replace enable_rfkill_int Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 23/28] iwlwifi: debug print in tx_queue_set_status is more clear Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 24/28] iwlwifi: clarify comment Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 25/28] iwlwifi: move bcast_sta_id init to common routine Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 26/28] iwlwifi: move all ucode routines to iwl-ucode.c Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 27/28] iwlwifi: release IRQ in error path Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 28/28] iwlwifi: range check to testmode direct reg access 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=1328224159-18134-10-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=emmanuel.grumbach@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;
as well as URLs for NNTP newsgroup(s).