From: Michael Buesch <mb@bu3sch.de>
To: John Linville <linville@tuxdriver.com>
Cc: bcm43xx-dev@lists.berlios.de, linux-wireless@vger.kernel.org
Subject: [PATCH] ssb: Use ioreadX() and iowriteX() for PCI.
Date: Wed, 19 Sep 2007 18:53:44 +0200 [thread overview]
Message-ID: <200709191853.44334.mb@bu3sch.de> (raw)
On a PCI bus use ioreadX() and iowriteX().
We map the I/O space with pci_iomap(), so we must use the correct
accessor functions, too.
readX() and writeX() are not guaranteed to accept the cookie returned
from pci_iomap() (though, it currently works on most architectures).
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Index: wireless-dev/drivers/ssb/pci.c
===================================================================
--- wireless-dev.orig/drivers/ssb/pci.c 2007-09-19 17:15:58.000000000 +0200
+++ wireless-dev/drivers/ssb/pci.c 2007-09-19 17:31:44.000000000 +0200
@@ -531,7 +531,7 @@ static u16 ssb_pci_read16(struct ssb_dev
if (unlikely(ssb_pci_switch_core(bus, dev)))
return 0xFFFF;
}
- return readw(bus->mmio + offset);
+ return ioread16(bus->mmio + offset);
}
static u32 ssb_pci_read32(struct ssb_device *dev, u16 offset)
@@ -544,7 +544,7 @@ static u32 ssb_pci_read32(struct ssb_dev
if (unlikely(ssb_pci_switch_core(bus, dev)))
return 0xFFFFFFFF;
}
- return readl(bus->mmio + offset);
+ return ioread32(bus->mmio + offset);
}
static void ssb_pci_write16(struct ssb_device *dev, u16 offset, u16 value)
@@ -557,7 +557,7 @@ static void ssb_pci_write16(struct ssb_d
if (unlikely(ssb_pci_switch_core(bus, dev)))
return;
}
- writew(value, bus->mmio + offset);
+ iowrite16(value, bus->mmio + offset);
}
static void ssb_pci_write32(struct ssb_device *dev, u16 offset, u32 value)
@@ -570,7 +570,7 @@ static void ssb_pci_write32(struct ssb_d
if (unlikely(ssb_pci_switch_core(bus, dev)))
return;
}
- writel(value, bus->mmio + offset);
+ iowrite32(value, bus->mmio + offset);
}
/* Not "static", as it's used in main.c */
reply other threads:[~2007-09-19 16:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200709191853.44334.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=bcm43xx-dev@lists.berlios.de \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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).