summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-03-02 22:46:50 -0500
committerBjorn Helgaas <bhelgaas@google.com>2016-03-12 07:00:29 -0500
commitd9c8bea179a6906a74ea42a2a162c4d1c6d9a16b (patch)
treec2d71dc7bfb2ae399a9fa08d4feb2db7c246756f /drivers/pci
parent97f47e73c4a0dc2519276cd63274696c850e0613 (diff)
PCI: Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY
The IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY bits are unused. Remove them and code that depends on them. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/remove.c1
-rw-r--r--drivers/pci/rom.c31
2 files changed, 1 insertions, 31 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 8a280e9c2ad1..6b66329a6bff 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -7,7 +7,6 @@ static void pci_free_resources(struct pci_dev *dev)
7{ 7{
8 int i; 8 int i;
9 9
10 pci_cleanup_rom(dev);
11 for (i = 0; i < PCI_NUM_RESOURCES; i++) { 10 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
12 struct resource *res = dev->resource + i; 11 struct resource *res = dev->resource + i;
13 if (res->parent) 12 if (res->parent)
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index 2a07f344616e..06663d391b39 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -128,12 +128,6 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
128 loff_t start; 128 loff_t start;
129 void __iomem *rom; 129 void __iomem *rom;
130 130
131 if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) {
132 *size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
133 return (void __iomem *)(unsigned long)
134 pci_resource_start(pdev, PCI_ROM_RESOURCE);
135 }
136
137 /* assign the ROM an address if it doesn't have one */ 131 /* assign the ROM an address if it doesn't have one */
138 if (res->parent == NULL && pci_assign_resource(pdev, PCI_ROM_RESOURCE)) 132 if (res->parent == NULL && pci_assign_resource(pdev, PCI_ROM_RESOURCE))
139 return NULL; 133 return NULL;
@@ -150,8 +144,7 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
150 rom = ioremap(start, *size); 144 rom = ioremap(start, *size);
151 if (!rom) { 145 if (!rom) {
152 /* restore enable if ioremap fails */ 146 /* restore enable if ioremap fails */
153 if (!(res->flags & (IORESOURCE_ROM_ENABLE | 147 if (!(res->flags & IORESOURCE_ROM_ENABLE))
154 IORESOURCE_ROM_COPY)))
155 pci_disable_rom(pdev); 148 pci_disable_rom(pdev);
156 return NULL; 149 return NULL;
157 } 150 }
@@ -177,9 +170,6 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom)
177{ 170{
178 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; 171 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
179 172
180 if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY))
181 return;
182
183 iounmap(rom); 173 iounmap(rom);
184 174
185 /* Disable again before continuing */ 175 /* Disable again before continuing */
@@ -189,25 +179,6 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom)
189EXPORT_SYMBOL(pci_unmap_rom); 179EXPORT_SYMBOL(pci_unmap_rom);
190 180
191/** 181/**
192 * pci_cleanup_rom - free the ROM copy created by pci_map_rom_copy
193 * @pdev: pointer to pci device struct
194 *
195 * Free the copied ROM if we allocated one.
196 */
197void pci_cleanup_rom(struct pci_dev *pdev)
198{
199 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
200
201 if (res->flags & IORESOURCE_ROM_COPY) {
202 kfree((void *)(unsigned long)res->start);
203 res->flags |= IORESOURCE_UNSET;
204 res->flags &= ~IORESOURCE_ROM_COPY;
205 res->start = 0;
206 res->end = 0;
207 }
208}
209
210/**
211 * pci_platform_rom - provides a pointer to any ROM image provided by the 182 * pci_platform_rom - provides a pointer to any ROM image provided by the
212 * platform 183 * platform
213 * @pdev: pointer to pci device struct 184 * @pdev: pointer to pci device struct