diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-01-04 07:23:20 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-02 17:35:53 -0500 |
commit | ea4caade104490de0fadb64660f9e228c050fb3d (patch) | |
tree | 8a73bba4502ea5865f969b567d6689e7bc01e60b | |
parent | 1042db2af183b96cdce5972014d85e8bca0634ad (diff) |
iwlwifi: remove the pointer to dev from the bus layer
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-bus.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-pci.c | 7 | ||||
-rw-r--r-- | 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 f79791500a9c..d890b6481b8c 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) | |||
1146 | iwl_dealloc_ucode(trans(priv)); | 1146 | iwl_dealloc_ucode(trans(priv)); |
1147 | out_unbind: | 1147 | out_unbind: |
1148 | complete(&priv->firmware_loading_complete); | 1148 | complete(&priv->firmware_loading_complete); |
1149 | device_release_driver(bus(priv)->dev); | 1149 | device_release_driver(trans(priv)->dev); |
1150 | release_firmware(ucode_raw); | 1150 | release_firmware(ucode_raw); |
1151 | } | 1151 | } |
1152 | 1152 | ||
@@ -1785,7 +1785,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | |||
1785 | 1785 | ||
1786 | /* At this point both hw and priv are allocated. */ | 1786 | /* At this point both hw and priv are allocated. */ |
1787 | 1787 | ||
1788 | SET_IEEE80211_DEV(hw, bus(priv)->dev); | 1788 | SET_IEEE80211_DEV(hw, trans(priv)->dev); |
1789 | 1789 | ||
1790 | /* what debugging capabilities we have */ | 1790 | /* what debugging capabilities we have */ |
1791 | iwl_debug_config(priv); | 1791 | iwl_debug_config(priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-bus.h b/drivers/net/wireless/iwlwifi/iwl-bus.h index ce1a9cc106eb..2065c5b74162 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 { | |||
137 | * | 137 | * |
138 | * This data is common to all bus layer implementations. | 138 | * This data is common to all bus layer implementations. |
139 | * | 139 | * |
140 | * @dev - pointer to struct device * that represents the device | ||
141 | * @ops - pointer to iwl_bus_ops | 140 | * @ops - pointer to iwl_bus_ops |
142 | * @shrd - pointer to iwl_shared which holds shared data from the upper layer | 141 | * @shrd - pointer to iwl_shared which holds shared data from the upper layer |
143 | * NB: for the time being this needs to be set by the upper layer since | 142 | * NB: for the time being this needs to be set by the upper layer since |
144 | * it allocates the shared data | 143 | * it allocates the shared data |
145 | */ | 144 | */ |
146 | struct iwl_bus { | 145 | struct iwl_bus { |
147 | struct device *dev; | ||
148 | const struct iwl_bus_ops *ops; | 146 | const struct iwl_bus_ops *ops; |
149 | struct iwl_shared *shrd; | 147 | struct iwl_shared *shrd; |
150 | 148 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 6f7612781e03..351b41d7f4fd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -35,10 +35,10 @@ | |||
35 | struct iwl_priv; | 35 | struct iwl_priv; |
36 | 36 | ||
37 | /*No matter what is m (priv, bus, trans), this will work */ | 37 | /*No matter what is m (priv, bus, trans), this will work */ |
38 | #define IWL_ERR(m, f, a...) dev_err(bus(m)->dev, f, ## a) | 38 | #define IWL_ERR(m, f, a...) dev_err(trans(m)->dev, f, ## a) |
39 | #define IWL_WARN(m, f, a...) dev_warn(bus(m)->dev, f, ## a) | 39 | #define IWL_WARN(m, f, a...) dev_warn(trans(m)->dev, f, ## a) |
40 | #define IWL_INFO(m, f, a...) dev_info(bus(m)->dev, f, ## a) | 40 | #define IWL_INFO(m, f, a...) dev_info(trans(m)->dev, f, ## a) |
41 | #define IWL_CRIT(m, f, a...) dev_crit(bus(m)->dev, f, ## a) | 41 | #define IWL_CRIT(m, f, a...) dev_crit(trans(m)->dev, f, ## a) |
42 | 42 | ||
43 | #define iwl_print_hex_error(m, p, len) \ | 43 | #define iwl_print_hex_error(m, p, len) \ |
44 | do { \ | 44 | do { \ |
@@ -50,7 +50,7 @@ do { \ | |||
50 | #define IWL_DEBUG(m, level, fmt, ...) \ | 50 | #define IWL_DEBUG(m, level, fmt, ...) \ |
51 | do { \ | 51 | do { \ |
52 | if (iwl_get_debug_level((m)->shrd) & (level)) \ | 52 | if (iwl_get_debug_level((m)->shrd) & (level)) \ |
53 | dev_err(bus(m)->dev, "%c %s " fmt, \ | 53 | dev_err(trans(m)->dev, "%c %s " fmt, \ |
54 | in_interrupt() ? 'I' : 'U', __func__, \ | 54 | in_interrupt() ? 'I' : 'U', __func__, \ |
55 | ##__VA_ARGS__); \ | 55 | ##__VA_ARGS__); \ |
56 | } while (0) | 56 | } while (0) |
@@ -59,7 +59,7 @@ do { \ | |||
59 | do { \ | 59 | do { \ |
60 | if (iwl_get_debug_level((m)->shrd) & (level) && \ | 60 | if (iwl_get_debug_level((m)->shrd) & (level) && \ |
61 | net_ratelimit()) \ | 61 | net_ratelimit()) \ |
62 | dev_err(bus(m)->dev, "%c %s " fmt, \ | 62 | dev_err(trans(m)->dev, "%c %s " fmt, \ |
63 | in_interrupt() ? 'I' : 'U', __func__, \ | 63 | in_interrupt() ? 'I' : 'U', __func__, \ |
64 | ##__VA_ARGS__); \ | 64 | ##__VA_ARGS__); \ |
65 | } while (0) | 65 | } while (0) |
@@ -74,12 +74,12 @@ do { \ | |||
74 | #define IWL_DEBUG_QUIET_RFKILL(p, fmt, ...) \ | 74 | #define IWL_DEBUG_QUIET_RFKILL(p, fmt, ...) \ |
75 | do { \ | 75 | do { \ |
76 | if (!iwl_is_rfkill(p->shrd)) \ | 76 | if (!iwl_is_rfkill(p->shrd)) \ |
77 | dev_err(bus(p)->dev, "%s%c %s " fmt, \ | 77 | dev_err(trans(p)->dev, "%s%c %s " fmt, \ |
78 | "", \ | 78 | "", \ |
79 | in_interrupt() ? 'I' : 'U', __func__, \ | 79 | in_interrupt() ? 'I' : 'U', __func__, \ |
80 | ##__VA_ARGS__); \ | 80 | ##__VA_ARGS__); \ |
81 | else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \ | 81 | else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \ |
82 | dev_err(bus(p)->dev, "%s%c %s " fmt, \ | 82 | dev_err(trans(p)->dev, "%s%c %s " fmt, \ |
83 | "(RFKILL) ", \ | 83 | "(RFKILL) ", \ |
84 | in_interrupt() ? 'I' : 'U', __func__, \ | 84 | in_interrupt() ? 'I' : 'U', __func__, \ |
85 | ##__VA_ARGS__); \ | 85 | ##__VA_ARGS__); \ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c index 7bab81928482..6451739aed2e 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) | |||
123 | /* L1-ASPM enabled; disable(!) L0S */ | 123 | /* L1-ASPM enabled; disable(!) L0S */ |
124 | iwl_set_bit(trans(bus), CSR_GIO_REG, | 124 | iwl_set_bit(trans(bus), CSR_GIO_REG, |
125 | CSR_GIO_REG_VAL_L0S_ENABLED); | 125 | CSR_GIO_REG_VAL_L0S_ENABLED); |
126 | dev_printk(KERN_INFO, bus->dev, "L1 Enabled; Disabling L0S\n"); | 126 | dev_printk(KERN_INFO, trans(bus)->dev, |
127 | "L1 Enabled; Disabling L0S\n"); | ||
127 | } else { | 128 | } else { |
128 | /* L1-ASPM disabled; enable(!) L0S */ | 129 | /* L1-ASPM disabled; enable(!) L0S */ |
129 | iwl_clear_bit(trans(bus), CSR_GIO_REG, | 130 | iwl_clear_bit(trans(bus), CSR_GIO_REG, |
130 | CSR_GIO_REG_VAL_L0S_ENABLED); | 131 | CSR_GIO_REG_VAL_L0S_ENABLED); |
131 | dev_printk(KERN_INFO, bus->dev, "L1 Disabled; Enabling L0S\n"); | 132 | dev_printk(KERN_INFO, trans(bus)->dev, |
133 | "L1 Disabled; Enabling L0S\n"); | ||
132 | } | 134 | } |
133 | } | 135 | } |
134 | 136 | ||
@@ -368,7 +370,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
368 | 370 | ||
369 | pci_set_drvdata(pdev, bus); | 371 | pci_set_drvdata(pdev, bus); |
370 | 372 | ||
371 | bus->dev = &pdev->dev; | ||
372 | bus->ops = &bus_ops_pci; | 373 | bus->ops = &bus_ops_pci; |
373 | 374 | ||
374 | #ifdef CONFIG_IWLWIFI_IDI | 375 | #ifdef CONFIG_IWLWIFI_IDI |
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c index 5de8b5beb091..08483d785e2c 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] = { | |||
83 | static void iwl_free_fw_desc(struct iwl_bus *bus, struct fw_desc *desc) | 83 | static void iwl_free_fw_desc(struct iwl_bus *bus, struct fw_desc *desc) |
84 | { | 84 | { |
85 | if (desc->v_addr) | 85 | if (desc->v_addr) |
86 | dma_free_coherent(bus->dev, desc->len, | 86 | dma_free_coherent(trans(bus)->dev, desc->len, |
87 | desc->v_addr, desc->p_addr); | 87 | desc->v_addr, desc->p_addr); |
88 | desc->v_addr = NULL; | 88 | desc->v_addr = NULL; |
89 | desc->len = 0; | 89 | desc->len = 0; |
@@ -110,7 +110,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc, | |||
110 | return -EINVAL; | 110 | return -EINVAL; |
111 | } | 111 | } |
112 | 112 | ||
113 | desc->v_addr = dma_alloc_coherent(bus->dev, len, | 113 | desc->v_addr = dma_alloc_coherent(trans(bus)->dev, len, |
114 | &desc->p_addr, GFP_KERNEL); | 114 | &desc->p_addr, GFP_KERNEL); |
115 | if (!desc->v_addr) | 115 | if (!desc->v_addr) |
116 | return -ENOMEM; | 116 | return -ENOMEM; |