From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>,
linux-wireless@vger.kernel.org,
Stanislaw Gruszka <sgruszka@redhat.com>
Subject: [RFC 4/4] iwlwifi: use writeb,writel,readl directly
Date: Mon, 6 Feb 2012 17:09:24 +0100 [thread overview]
Message-ID: <1328544564-8696-4-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1328544564-8696-1-git-send-email-sgruszka@redhat.com>
That will save us some CPU cycles at run time.
Obviously I do not think port-based IO is possible, but I added
check for that during probe just in case.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlwifi/iwl-pci.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 03702a2..32b326d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -153,18 +153,17 @@ static u32 iwl_pci_get_hw_id(struct iwl_bus *bus)
static void iwl_pci_write8(struct iwl_bus *bus, u32 ofs, u8 val)
{
- iowrite8(val, IWL_BUS_GET_PCI_BUS(bus)->hw_base + ofs);
+ writeb(val, IWL_BUS_GET_PCI_BUS(bus)->hw_base + ofs);
}
static void iwl_pci_write32(struct iwl_bus *bus, u32 ofs, u32 val)
{
- iowrite32(val, IWL_BUS_GET_PCI_BUS(bus)->hw_base + ofs);
+ writel(val, IWL_BUS_GET_PCI_BUS(bus)->hw_base + ofs);
}
static u32 iwl_pci_read32(struct iwl_bus *bus, u32 ofs)
{
- u32 val = ioread32(IWL_BUS_GET_PCI_BUS(bus)->hw_base + ofs);
- return val;
+ return readl(IWL_BUS_GET_PCI_BUS(bus)->hw_base + ofs);
}
static const struct iwl_bus_ops bus_ops_pci = {
@@ -417,6 +416,11 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_pci_disable_device;
}
+ if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) {
+ dev_printk(KERN_ERR, bus->dev, "not supported I/O method");
+ goto out_pci_disable_device;
+ }
+
pci_bus->hw_base = pci_iomap(pdev, 0, 0);
if (!pci_bus->hw_base) {
dev_printk(KERN_ERR, bus->dev, "pci_iomap failed");
--
1.7.1
next prev parent reply other threads:[~2012-02-06 16:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-06 16:09 [RFC 1/4] iwlwifi: dump stack when fail to gain access to the device Stanislaw Gruszka
2012-02-06 16:08 ` wwguy
2012-02-07 8:01 ` Stanislaw Gruszka
2012-02-07 14:21 ` Guy, Wey-Yi
2012-02-08 10:52 ` Stanislaw Gruszka
2012-02-06 16:09 ` [RFC 2/4] iwlwifi: always check if got h/w access before write Stanislaw Gruszka
2012-02-06 16:13 ` wwguy
2012-02-07 8:05 ` Stanislaw Gruszka
2012-02-07 14:20 ` Guy, Wey-Yi
2012-02-06 16:09 ` [RFC 3/4] iwlwifi: cleanup/fix memory barriers Stanislaw Gruszka
2012-02-06 16:13 ` Johannes Berg
2012-02-07 8:11 ` Stanislaw Gruszka
2012-02-07 8:25 ` Johannes Berg
2012-02-06 16:09 ` Stanislaw Gruszka [this message]
2012-02-06 16:32 ` [RFC 4/4] iwlwifi: use writeb,writel,readl directly wwguy
2012-02-07 8:22 ` Stanislaw Gruszka
2012-02-07 14:22 ` Guy, Wey-Yi
2012-02-10 12:01 ` [RFC 1/4] iwlwifi: dump stack when fail to gain access to the device Stanislaw Gruszka
2012-02-23 10:14 ` Stanislaw Gruszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1328544564-8696-4-git-send-email-sgruszka@redhat.com \
--to=sgruszka@redhat.com \
--cc=ilw@linux.intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=wey-yi.w.guy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).