iwlwifi: don't use shared for the logger any more
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 22 Mar 2012 21:59:52 +0000 (23:59 +0200)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Wed, 18 Apr 2012 14:31:11 +0000 (07:31 -0700)
Each modules will hold a pointer to struct device instead.

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
drivers/net/wireless/iwlwifi/iwl-agn.h
drivers/net/wireless/iwlwifi/iwl-debug.h
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-drv.c
drivers/net/wireless/iwlwifi/iwl-phy-db.c
drivers/net/wireless/iwlwifi/iwl-phy-db.h

index 6771b6d..3f8b30d 100644 (file)
@@ -1509,6 +1509,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
        priv = IWL_OP_MODE_GET_DVM(op_mode);
        priv->shrd = trans->shrd;
        priv->trans = trans;
+       priv->dev = trans->dev;
        priv->cfg = cfg;
        priv->fw = fw;
 
index 8a09d0c..67cd123 100644 (file)
@@ -481,7 +481,7 @@ do {                                                                        \
        if (!iwl_is_rfkill((m)))                                        \
                IWL_ERR(m, fmt, ##args);                                \
        else                                                            \
-               __iwl_err(trans(m)->dev, true,                          \
+               __iwl_err((m)->dev, true,                               \
                          !iwl_have_debug_level(IWL_DL_RADIO),          \
                          fmt, ##args);                                 \
 } while (0)
@@ -491,7 +491,7 @@ do {                                                                        \
        if (!iwl_is_rfkill((m)))                                        \
                IWL_ERR(m, fmt, ##args);                                \
        else                                                            \
-               __iwl_err(trans(m)->dev, true, true, fmt, ##args);      \
+               __iwl_err((m)->dev, true, true, fmt, ##args);   \
 } while (0)
 #endif                         /* CONFIG_IWLWIFI_DEBUG */
 
index a6b32a1..8bae7cc 100644 (file)
@@ -41,10 +41,10 @@ void __iwl_info(struct device *dev, const char *fmt, ...);
 void __iwl_crit(struct device *dev, const char *fmt, ...);
 
 /* No matter what is m (priv, bus, trans), this will work */
-#define IWL_ERR(m, f, a...) __iwl_err(trans(m)->dev, false, false, f, ## a)
-#define IWL_WARN(m, f, a...) __iwl_warn(trans(m)->dev, f, ## a)
-#define IWL_INFO(m, f, a...) __iwl_info(trans(m)->dev, f, ## a)
-#define IWL_CRIT(m, f, a...) __iwl_crit(trans(m)->dev, f, ## a)
+#define IWL_ERR(m, f, a...) __iwl_err((m)->dev, false, false, f, ## a)
+#define IWL_WARN(m, f, a...) __iwl_warn((m)->dev, f, ## a)
+#define IWL_INFO(m, f, a...) __iwl_info((m)->dev, f, ## a)
+#define IWL_CRIT(m, f, a...) __iwl_crit((m)->dev, f, ## a)
 
 #if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING)
 void __iwl_dbg(struct device *dev,
@@ -65,9 +65,9 @@ do {                                                                  \
 } while (0)
 
 #define IWL_DEBUG(m, level, fmt, args...)                              \
-       __iwl_dbg(trans(m)->dev, level, false, __func__, fmt, ##args)
+       __iwl_dbg((m)->dev, level, false, __func__, fmt, ##args)
 #define IWL_DEBUG_LIMIT(m, level, fmt, args...)                                \
-       __iwl_dbg(trans(m)->dev, level, true, __func__, fmt, ##args)
+       __iwl_dbg((m)->dev, level, true, __func__, fmt, ##args)
 
 #ifdef CONFIG_IWLWIFI_DEBUG
 #define iwl_print_hex_dump(m, level, p, len)                           \
index 33d5878..185289f 100644 (file)
@@ -761,6 +761,7 @@ struct iwl_priv {
        /*data shared among all the driver's layers */
        struct iwl_shared *shrd;
        struct iwl_trans *trans;
+       struct device *dev;             /* for debug prints only */
        const struct iwl_cfg *cfg;
        const struct iwl_fw *fw;
        const struct iwl_lib_ops *lib;
index 8270623..1221a8c 100644 (file)
@@ -80,6 +80,7 @@
  * @shrd: pointer to common shared structure
  * @op_mode: the running op_mode
  * @trans: transport layer
+ * @dev: for debug prints only
  * @cfg: configuration struct
  * @fw_index: firmware revision to try loading
  * @firmware_name: composite filename of ucode file to load
@@ -91,6 +92,7 @@ struct iwl_drv {
        struct iwl_shared *shrd;
        struct iwl_op_mode *op_mode;
        struct iwl_trans *trans;
+       struct device *dev;
        const struct iwl_cfg *cfg;
 
        int fw_index;                   /* firmware we're trying to load */
@@ -898,6 +900,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_shared *shrd,
        /* For printing only - temporary until we change the logger */
        drv->shrd = shrd;
        drv->trans = trans;
+       drv->dev = trans->dev;
        drv->cfg = cfg;
 
        init_completion(&drv->request_firmware_complete);
index 1a791af..f166955 100644 (file)
 #include <linux/string.h>
 
 #include "iwl-debug.h"
-#include "iwl-shared.h"
 #include "iwl-dev.h"
 
 #include "iwl-phy-db.h"
 
 #define CHANNEL_NUM_SIZE       4       /* num of channels in calib_ch size */
 
-struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd)
+struct iwl_phy_db *iwl_phy_db_init(struct device *dev)
 {
        struct iwl_phy_db *phy_db = kzalloc(sizeof(struct iwl_phy_db),
                                            GFP_KERNEL);
@@ -80,7 +79,7 @@ struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd)
        if (!phy_db)
                return phy_db;
 
-       phy_db->shrd = shrd;
+       phy_db->dev = dev;
 
        /* TODO: add default values of the phy db. */
        return phy_db;
index 5e86305..c34c6a9 100644 (file)
@@ -96,7 +96,7 @@ struct iwl_phy_db {
        u32 channel_size;
 
        /* for an access to the logger */
-       const struct iwl_shared *shrd;
+       struct device *dev;
 };
 
 enum iwl_phy_db_section_type {
@@ -114,7 +114,7 @@ struct iwl_phy_db_chg_txp {
        __le16 max_channel_idx;
 } __packed;
 
-struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd);
+struct iwl_phy_db *iwl_phy_db_init(struct device *dev);
 
 void iwl_phy_db_free(struct iwl_phy_db *phy_db);