Commit 05f5b97e authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

iwlwifi: use writeb,writel,readl directly

That change will save us some CPU cycles at run time. Having port-based
I/O seems to be not possible for PCIe devices.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@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 3a73a300
config IWLWIFI config IWLWIFI
tristate "Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) " tristate "Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) "
depends on PCI && MAC80211 depends on PCI && MAC80211 && HAS_IOMEM
select FW_LOADER select FW_LOADER
select NEW_LEDS select NEW_LEDS
select LEDS_CLASS select LEDS_CLASS
......
...@@ -1600,18 +1600,17 @@ static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, ...@@ -1600,18 +1600,17 @@ static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,
static void iwl_trans_pcie_write8(struct iwl_trans *trans, u32 ofs, u8 val) static void iwl_trans_pcie_write8(struct iwl_trans *trans, u32 ofs, u8 val)
{ {
iowrite8(val, IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); writeb(val, IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs);
} }
static void iwl_trans_pcie_write32(struct iwl_trans *trans, u32 ofs, u32 val) static void iwl_trans_pcie_write32(struct iwl_trans *trans, u32 ofs, u32 val)
{ {
iowrite32(val, IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); writel(val, IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs);
} }
static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs) static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs)
{ {
u32 val = ioread32(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs);
return val;
} }
static void iwl_trans_pcie_free(struct iwl_trans *trans) static void iwl_trans_pcie_free(struct iwl_trans *trans)
...@@ -1629,7 +1628,7 @@ static void iwl_trans_pcie_free(struct iwl_trans *trans) ...@@ -1629,7 +1628,7 @@ static void iwl_trans_pcie_free(struct iwl_trans *trans)
} }
pci_disable_msi(trans_pcie->pci_dev); pci_disable_msi(trans_pcie->pci_dev);
pci_iounmap(trans_pcie->pci_dev, trans_pcie->hw_base); iounmap(trans_pcie->hw_base);
pci_release_regions(trans_pcie->pci_dev); pci_release_regions(trans_pcie->pci_dev);
pci_disable_device(trans_pcie->pci_dev); pci_disable_device(trans_pcie->pci_dev);
...@@ -2258,9 +2257,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd, ...@@ -2258,9 +2257,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd,
goto out_pci_disable_device; goto out_pci_disable_device;
} }
trans_pcie->hw_base = pci_iomap(pdev, 0, 0); trans_pcie->hw_base = pci_ioremap_bar(pdev, 0);
if (!trans_pcie->hw_base) { if (!trans_pcie->hw_base) {
dev_printk(KERN_ERR, &pdev->dev, "pci_iomap failed"); dev_printk(KERN_ERR, &pdev->dev, "pci_ioremap_bar failed");
err = -ENODEV; err = -ENODEV;
goto out_pci_release_regions; goto out_pci_release_regions;
} }
......
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