Commit 26bfc0cf authored by Don Fry's avatar Don Fry Committed by John W. Linville

iwlagn: eliminate bus pointer from iwl_priv structure

A pointer to the bus structure is still in iwl_priv.  Finish
cleanup and remove it.
Signed-off-by: default avatarDon Fry <donald.h.fry@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3eae4bb1
...@@ -463,7 +463,7 @@ static void iwl_bg_tx_flush(struct work_struct *work) ...@@ -463,7 +463,7 @@ static void iwl_bg_tx_flush(struct work_struct *work)
static void iwl_free_fw_desc(struct iwl_priv *priv, struct fw_desc *desc) static void iwl_free_fw_desc(struct iwl_priv *priv, struct fw_desc *desc)
{ {
if (desc->v_addr) if (desc->v_addr)
dma_free_coherent(priv->bus->dev, desc->len, dma_free_coherent(bus(priv)->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;
...@@ -490,7 +490,7 @@ static int iwl_alloc_fw_desc(struct iwl_priv *priv, struct fw_desc *desc, ...@@ -490,7 +490,7 @@ static int iwl_alloc_fw_desc(struct iwl_priv *priv, struct fw_desc *desc,
return -EINVAL; return -EINVAL;
} }
desc->v_addr = dma_alloc_coherent(priv->bus->dev, len, desc->v_addr = dma_alloc_coherent(bus(priv)->dev, len,
&desc->p_addr, GFP_KERNEL); &desc->p_addr, GFP_KERNEL);
if (!desc->v_addr) if (!desc->v_addr)
return -ENOMEM; return -ENOMEM;
...@@ -602,7 +602,7 @@ static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first) ...@@ -602,7 +602,7 @@ static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first)
priv->firmware_name); priv->firmware_name);
return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name, return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name,
priv->bus->dev, bus(priv)->dev,
GFP_KERNEL, priv, iwl_ucode_callback); GFP_KERNEL, priv, iwl_ucode_callback);
} }
...@@ -1161,7 +1161,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) ...@@ -1161,7 +1161,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
iwl_dealloc_ucode(priv); iwl_dealloc_ucode(priv);
out_unbind: out_unbind:
complete(&priv->firmware_loading_complete); complete(&priv->firmware_loading_complete);
device_release_driver(priv->bus->dev); device_release_driver(bus(priv)->dev);
release_firmware(ucode_raw); release_firmware(ucode_raw);
} }
...@@ -1701,7 +1701,7 @@ static int iwl_mac_setup_register(struct iwl_priv *priv, ...@@ -1701,7 +1701,7 @@ static int iwl_mac_setup_register(struct iwl_priv *priv,
WIPHY_FLAG_DISABLE_BEACON_HINTS | WIPHY_FLAG_DISABLE_BEACON_HINTS |
WIPHY_FLAG_IBSS_RSN; WIPHY_FLAG_IBSS_RSN;
if (priv->ucode_wowlan.code.len && device_can_wakeup(priv->bus->dev)) { if (priv->ucode_wowlan.code.len && device_can_wakeup(bus(priv)->dev)) {
hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT | hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
WIPHY_WOWLAN_DISCONNECT | WIPHY_WOWLAN_DISCONNECT |
WIPHY_WOWLAN_EAP_IDENTITY_REQ | WIPHY_WOWLAN_EAP_IDENTITY_REQ |
...@@ -2188,7 +2188,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw, ...@@ -2188,7 +2188,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
if (ret) if (ret)
goto error; goto error;
device_set_wakeup_enable(priv->bus->dev, true); device_set_wakeup_enable(bus(priv)->dev, true);
/* Now let the ucode operate on its own */ /* Now let the ucode operate on its own */
iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_SET, iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_SET,
...@@ -2251,7 +2251,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -2251,7 +2251,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
priv->shrd->wowlan = false; priv->shrd->wowlan = false;
device_set_wakeup_enable(priv->bus->dev, false); device_set_wakeup_enable(bus(priv)->dev, false);
iwlagn_prepare_restart(priv); iwlagn_prepare_restart(priv);
...@@ -3193,7 +3193,6 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, ...@@ -3193,7 +3193,6 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
} }
priv = hw->priv; priv = hw->priv;
priv->bus = bus;
priv->shrd = &priv->_shrd; priv->shrd = &priv->_shrd;
bus->shrd = priv->shrd; bus->shrd = priv->shrd;
priv->shrd->bus = bus; priv->shrd->bus = bus;
...@@ -3207,7 +3206,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, ...@@ -3207,7 +3206,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, priv->bus->dev); SET_IEEE80211_DEV(hw, bus(priv)->dev);
IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n"); IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
priv->cfg = cfg; priv->cfg = cfg;
......
...@@ -211,7 +211,7 @@ int iwl_init_geos(struct iwl_priv *priv) ...@@ -211,7 +211,7 @@ int iwl_init_geos(struct iwl_priv *priv)
if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
priv->cfg->sku & EEPROM_SKU_CAP_BAND_52GHZ) { priv->cfg->sku & EEPROM_SKU_CAP_BAND_52GHZ) {
char buf[32]; char buf[32];
bus_get_hw_id(priv->bus, buf, sizeof(buf)); bus_get_hw_id(bus(priv), buf, sizeof(buf));
IWL_INFO(priv, "Incorrectly detected BG card as ABG. " IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
"Please send your %s to maintainer.\n", buf); "Please send your %s to maintainer.\n", buf);
priv->cfg->sku &= ~EEPROM_SKU_CAP_BAND_52GHZ; priv->cfg->sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
...@@ -979,7 +979,7 @@ int iwl_apm_init(struct iwl_priv *priv) ...@@ -979,7 +979,7 @@ int iwl_apm_init(struct iwl_priv *priv)
iwl_set_bit(bus(priv), CSR_HW_IF_CONFIG_REG, iwl_set_bit(bus(priv), CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A);
bus_apm_config(priv->bus); bus_apm_config(bus(priv));
/* Configure analog phase-lock-loop before activating to D0A */ /* Configure analog phase-lock-loop before activating to D0A */
if (priv->cfg->base_params->pll_cfg_val) if (priv->cfg->base_params->pll_cfg_val)
......
...@@ -894,9 +894,6 @@ struct iwl_priv { ...@@ -894,9 +894,6 @@ struct iwl_priv {
u8 scan_tx_ant[IEEE80211_NUM_BANDS]; u8 scan_tx_ant[IEEE80211_NUM_BANDS];
u8 mgmt_tx_ant; u8 mgmt_tx_ant;
/*TODO: remove these pointers - use bus(priv) instead */
struct iwl_bus *bus; /* bus specific data */
/* max number of station keys */ /* max number of station keys */
u8 sta_key_max_num; u8 sta_key_max_num;
......
...@@ -202,8 +202,7 @@ void iwl_leds_init(struct iwl_priv *priv) ...@@ -202,8 +202,7 @@ void iwl_leds_init(struct iwl_priv *priv)
break; break;
} }
ret = led_classdev_register(priv->bus->dev, ret = led_classdev_register(bus(priv)->dev, &priv->led);
&priv->led);
if (ret) { if (ret) {
kfree(priv->led.name); kfree(priv->led.name);
return; return;
......
...@@ -436,7 +436,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) ...@@ -436,7 +436,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
/* initialize to default */ /* initialize to default */
void iwl_power_initialize(struct iwl_priv *priv) void iwl_power_initialize(struct iwl_priv *priv)
{ {
priv->power_data.bus_pm = bus_get_pm_support(priv->bus); priv->power_data.bus_pm = bus_get_pm_support(bus(priv));
priv->power_data.debug_sleep_level_override = -1; priv->power_data.debug_sleep_level_override = -1;
......
...@@ -184,7 +184,7 @@ static void iwl_trace_cleanup(struct iwl_priv *priv) ...@@ -184,7 +184,7 @@ static void iwl_trace_cleanup(struct iwl_priv *priv)
if (priv->testmode_trace.trace_enabled) { if (priv->testmode_trace.trace_enabled) {
if (priv->testmode_trace.cpu_addr && if (priv->testmode_trace.cpu_addr &&
priv->testmode_trace.dma_addr) priv->testmode_trace.dma_addr)
dma_free_coherent(priv->bus->dev, dma_free_coherent(bus(priv)->dev,
priv->testmode_trace.total_size, priv->testmode_trace.total_size,
priv->testmode_trace.cpu_addr, priv->testmode_trace.cpu_addr,
priv->testmode_trace.dma_addr); priv->testmode_trace.dma_addr);
...@@ -484,7 +484,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -484,7 +484,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb)
struct iwl_priv *priv = hw->priv; struct iwl_priv *priv = hw->priv;
struct sk_buff *skb; struct sk_buff *skb;
int status = 0; int status = 0;
struct device *dev = priv->bus->dev; struct device *dev = bus(priv)->dev;
switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) { switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) {
case IWL_TM_CMD_APP2DEV_BEGIN_TRACE: case IWL_TM_CMD_APP2DEV_BEGIN_TRACE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment