diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-01 19:41:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-01 19:41:27 -0500 |
commit | 72a73a69f6a79266b8b4b18f796907b73a5c01e3 (patch) | |
tree | 7684193f3c7f21b0ca14c430b8ead75b2c2025eb /drivers/pci/rom.c | |
parent | 4549df891a31b9a05b7d183106c09049b79327be (diff) | |
parent | 2b290da053608692ea206507d993b70c39d2cdea (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (28 commits)
PCI: make arch/i386/pci/common.c:pci_bf_sort static
PCI: ibmphp_pci.c: fix NULL dereference
pciehp: remove unnecessary pci_disable_msi
pciehp: remove unnecessary free_irq
PCI: rpaphp: change device tree examination
PCI: Change memory allocation for acpiphp slots
i2c-i801: SMBus patch for Intel ICH9
PCI: irq: irq and pci_ids patch for Intel ICH9
PCI: pci_{enable,disable}_device() nestable ports
PCI: switch pci_{enable,disable}_device() to be nestable
PCI: arch/i386/kernel/pci-dma.c: ioremap balanced with iounmap
pci/i386: style cleanups
PCI: Block on access to temporarily unavailable pci device
pci: fix __pci_register_driver error handling
pci: clear osc support flags if no _OSC method
acpiphp: fix missing acpiphp_glue_exit()
acpiphp: fix use of list_for_each macro
Altix: Initial ACPI support - ROM shadowing.
Altix: SN ACPI hotplug support.
Altix: Add initial ACPI IO support
...
Diffstat (limited to 'drivers/pci/rom.c')
-rw-r--r-- | drivers/pci/rom.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index e1dcefc69bb4..d087e0817715 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c | |||
@@ -81,7 +81,8 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) | |||
81 | start = (loff_t)0xC0000; | 81 | start = (loff_t)0xC0000; |
82 | *size = 0x20000; /* cover C000:0 through E000:0 */ | 82 | *size = 0x20000; /* cover C000:0 through E000:0 */ |
83 | } else { | 83 | } else { |
84 | if (res->flags & IORESOURCE_ROM_COPY) { | 84 | if (res->flags & |
85 | (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) { | ||
85 | *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); | 86 | *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); |
86 | return (void __iomem *)(unsigned long) | 87 | return (void __iomem *)(unsigned long) |
87 | pci_resource_start(pdev, PCI_ROM_RESOURCE); | 88 | pci_resource_start(pdev, PCI_ROM_RESOURCE); |
@@ -165,7 +166,8 @@ void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size) | |||
165 | if (!rom) | 166 | if (!rom) |
166 | return NULL; | 167 | return NULL; |
167 | 168 | ||
168 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_SHADOW)) | 169 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_SHADOW | |
170 | IORESOURCE_ROM_BIOS_COPY)) | ||
169 | return rom; | 171 | return rom; |
170 | 172 | ||
171 | res->start = (unsigned long)kmalloc(*size, GFP_KERNEL); | 173 | res->start = (unsigned long)kmalloc(*size, GFP_KERNEL); |
@@ -191,7 +193,7 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) | |||
191 | { | 193 | { |
192 | struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; | 194 | struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; |
193 | 195 | ||
194 | if (res->flags & IORESOURCE_ROM_COPY) | 196 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) |
195 | return; | 197 | return; |
196 | 198 | ||
197 | iounmap(rom); | 199 | iounmap(rom); |
@@ -215,6 +217,7 @@ void pci_remove_rom(struct pci_dev *pdev) | |||
215 | sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr); | 217 | sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr); |
216 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | | 218 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | |
217 | IORESOURCE_ROM_SHADOW | | 219 | IORESOURCE_ROM_SHADOW | |
220 | IORESOURCE_ROM_BIOS_COPY | | ||
218 | IORESOURCE_ROM_COPY))) | 221 | IORESOURCE_ROM_COPY))) |
219 | pci_disable_rom(pdev); | 222 | pci_disable_rom(pdev); |
220 | } | 223 | } |