提交 ea4caade 编写于 作者: E Emmanuel Grumbach 提交者: Wey-Yi Guy

iwlwifi: remove the pointer to dev from the bus layer

Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NWey-Yi Guy <wey-yi.w.guy@intel.com>
上级 1042db2a
...@@ -1146,7 +1146,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) ...@@ -1146,7 +1146,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
iwl_dealloc_ucode(trans(priv)); iwl_dealloc_ucode(trans(priv));
out_unbind: out_unbind:
complete(&priv->firmware_loading_complete); complete(&priv->firmware_loading_complete);
device_release_driver(bus(priv)->dev); device_release_driver(trans(priv)->dev);
release_firmware(ucode_raw); release_firmware(ucode_raw);
} }
...@@ -1785,7 +1785,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, ...@@ -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. */ /* 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 */ /* what debugging capabilities we have */
iwl_debug_config(priv); iwl_debug_config(priv);
......
...@@ -137,14 +137,12 @@ struct iwl_bus_ops { ...@@ -137,14 +137,12 @@ struct iwl_bus_ops {
* *
* This data is common to all bus layer implementations. * This data is common to all bus layer implementations.
* *
* @dev - pointer to struct device * that represents the device
* @ops - pointer to iwl_bus_ops * @ops - pointer to iwl_bus_ops
* @shrd - pointer to iwl_shared which holds shared data from the upper layer * @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 * NB: for the time being this needs to be set by the upper layer since
* it allocates the shared data * it allocates the shared data
*/ */
struct iwl_bus { struct iwl_bus {
struct device *dev;
const struct iwl_bus_ops *ops; const struct iwl_bus_ops *ops;
struct iwl_shared *shrd; struct iwl_shared *shrd;
......
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
struct iwl_priv; struct iwl_priv;
/*No matter what is m (priv, bus, trans), this will work */ /*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_ERR(m, f, a...) dev_err(trans(m)->dev, f, ## a)
#define IWL_WARN(m, f, a...) dev_warn(bus(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(bus(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(bus(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) \ #define iwl_print_hex_error(m, p, len) \
do { \ do { \
...@@ -50,7 +50,7 @@ do { \ ...@@ -50,7 +50,7 @@ do { \
#define IWL_DEBUG(m, level, fmt, ...) \ #define IWL_DEBUG(m, level, fmt, ...) \
do { \ do { \
if (iwl_get_debug_level((m)->shrd) & (level)) \ 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__, \ in_interrupt() ? 'I' : 'U', __func__, \
##__VA_ARGS__); \ ##__VA_ARGS__); \
} while (0) } while (0)
...@@ -59,7 +59,7 @@ do { \ ...@@ -59,7 +59,7 @@ do { \
do { \ do { \
if (iwl_get_debug_level((m)->shrd) & (level) && \ if (iwl_get_debug_level((m)->shrd) & (level) && \
net_ratelimit()) \ net_ratelimit()) \
dev_err(bus(m)->dev, "%c %s " fmt, \ dev_err(trans(m)->dev, "%c %s " fmt, \
in_interrupt() ? 'I' : 'U', __func__, \ in_interrupt() ? 'I' : 'U', __func__, \
##__VA_ARGS__); \ ##__VA_ARGS__); \
} while (0) } while (0)
...@@ -74,12 +74,12 @@ do { \ ...@@ -74,12 +74,12 @@ do { \
#define IWL_DEBUG_QUIET_RFKILL(p, fmt, ...) \ #define IWL_DEBUG_QUIET_RFKILL(p, fmt, ...) \
do { \ do { \
if (!iwl_is_rfkill(p->shrd)) \ 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__, \ in_interrupt() ? 'I' : 'U', __func__, \
##__VA_ARGS__); \ ##__VA_ARGS__); \
else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \ 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) ", \ "(RFKILL) ", \
in_interrupt() ? 'I' : 'U', __func__, \ in_interrupt() ? 'I' : 'U', __func__, \
##__VA_ARGS__); \ ##__VA_ARGS__); \
......
...@@ -123,12 +123,14 @@ static void iwl_pci_apm_config(struct iwl_bus *bus) ...@@ -123,12 +123,14 @@ static void iwl_pci_apm_config(struct iwl_bus *bus)
/* L1-ASPM enabled; disable(!) L0S */ /* L1-ASPM enabled; disable(!) L0S */
iwl_set_bit(trans(bus), CSR_GIO_REG, iwl_set_bit(trans(bus), CSR_GIO_REG,
CSR_GIO_REG_VAL_L0S_ENABLED); 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 { } else {
/* L1-ASPM disabled; enable(!) L0S */ /* L1-ASPM disabled; enable(!) L0S */
iwl_clear_bit(trans(bus), CSR_GIO_REG, iwl_clear_bit(trans(bus), CSR_GIO_REG,
CSR_GIO_REG_VAL_L0S_ENABLED); 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) ...@@ -368,7 +370,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, bus); pci_set_drvdata(pdev, bus);
bus->dev = &pdev->dev;
bus->ops = &bus_ops_pci; bus->ops = &bus_ops_pci;
#ifdef CONFIG_IWLWIFI_IDI #ifdef CONFIG_IWLWIFI_IDI
......
...@@ -83,7 +83,7 @@ static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = { ...@@ -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) static void iwl_free_fw_desc(struct iwl_bus *bus, struct fw_desc *desc)
{ {
if (desc->v_addr) 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, desc->p_addr);
desc->v_addr = NULL; desc->v_addr = NULL;
desc->len = 0; desc->len = 0;
...@@ -110,7 +110,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc, ...@@ -110,7 +110,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc,
return -EINVAL; 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); &desc->p_addr, GFP_KERNEL);
if (!desc->v_addr) if (!desc->v_addr)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册