Commit ad3754d9 authored by Linus Torvalds's avatar Linus Torvalds

misc: pci memory access annotations

Basic serial ports, acpi and intel sound.

Can you guess what my laptop has in it?
parent 15a234b3
......@@ -83,7 +83,7 @@ struct pci_serial_quirk {
struct serial_private {
unsigned int nr;
void *remapped_bar[PCI_NUM_BAR_RESOURCES];
void __iomem *remapped_bar[PCI_NUM_BAR_RESOURCES];
struct pci_serial_quirk *quirk;
int line[0];
};
......@@ -243,7 +243,8 @@ static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
*/
static int __devinit pci_plx9050_init(struct pci_dev *dev)
{
u8 *p, irq_config;
u8 irq_config;
void __iomem *p;
if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
moan_device("no memory in bar 0", dev);
......@@ -272,12 +273,12 @@ static int __devinit pci_plx9050_init(struct pci_dev *dev)
p = ioremap(pci_resource_start(dev, 0), 0x80);
if (p == NULL)
return -ENOMEM;
writel(irq_config, (unsigned long)p + 0x4c);
writel(irq_config, p + 0x4c);
/*
* Read the register back to ensure that it took effect.
*/
readl((unsigned long)p + 0x4c);
readl(p + 0x4c);
iounmap(p);
return 0;
......@@ -397,7 +398,8 @@ static void __devexit sbs_exit(struct pci_dev *dev)
static int pci_siig10x_init(struct pci_dev *dev)
{
u16 data, *p;
u16 data;
void __iomem *p;
switch (dev->device & 0xfff8) {
case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
......@@ -415,8 +417,8 @@ static int pci_siig10x_init(struct pci_dev *dev)
if (p == NULL)
return -ENOMEM;
writew(readw((unsigned long) p + 0x28) & data, (unsigned long) p + 0x28);
readw((unsigned long)p + 0x28);
writew(readw(p + 0x28) & data, p + 0x28);
readw(p + 0x28);
iounmap(p);
return 0;
}
......
......@@ -169,11 +169,11 @@ acpi_status
acpi_os_map_memory (
acpi_physical_address physical_address,
acpi_size size,
void **logical_address);
void __iomem **logical_address);
void
acpi_os_unmap_memory (
void *logical_address,
void __iomem *logical_address,
acpi_size size);
acpi_status
......
......@@ -406,10 +406,10 @@ struct _snd_intel8x0 {
unsigned int mmio;
unsigned long addr;
unsigned long remap_addr;
void __iomem * remap_addr;
unsigned int bm_mmio;
unsigned long bmaddr;
unsigned long remap_bmaddr;
void __iomem * remap_bmaddr;
struct pci_dev *pci;
snd_card_t *card;
......@@ -2227,9 +2227,9 @@ static int snd_intel8x0_free(intel8x0_t *chip)
snd_dma_free_pages(&chip->bdbars);
}
if (chip->remap_addr)
iounmap((void *) chip->remap_addr);
iounmap(chip->remap_addr);
if (chip->remap_bmaddr)
iounmap((void *) chip->remap_bmaddr);
iounmap(chip->remap_bmaddr);
pci_release_regions(chip->pci);
kfree(chip);
return 0;
......@@ -2502,9 +2502,8 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
if (pci_resource_flags(pci, 2) & IORESOURCE_MEM) { /* ICH4 and Nforce */
chip->mmio = 1;
chip->addr = pci_resource_start(pci, 2);
chip->remap_addr = (unsigned long) ioremap_nocache(chip->addr,
pci_resource_len(pci, 2));
if (chip->remap_addr == 0) {
chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci, 2));
if (!chip->remap_addr) {
snd_printk("AC'97 space ioremap problem\n");
snd_intel8x0_free(chip);
return -EIO;
......@@ -2515,9 +2514,8 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
if (pci_resource_flags(pci, 3) & IORESOURCE_MEM) { /* ICH4 */
chip->bm_mmio = 1;
chip->bmaddr = pci_resource_start(pci, 3);
chip->remap_bmaddr = (unsigned long) ioremap_nocache(chip->bmaddr,
pci_resource_len(pci, 3));
if (chip->remap_bmaddr == 0) {
chip->remap_bmaddr = ioremap_nocache(chip->bmaddr, pci_resource_len(pci, 3));
if (!chip->remap_bmaddr) {
snd_printk("Controller space ioremap problem\n");
snd_intel8x0_free(chip);
return -EIO;
......
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