diff options
Diffstat (limited to 'drivers/mtd/maps/pci.c')
-rw-r--r-- | drivers/mtd/maps/pci.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index 5c6a25c90380..48f4cf5cb9d1 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c | |||
@@ -203,15 +203,8 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map) | |||
203 | * not enabled, should we be allocating a new resource for it | 203 | * not enabled, should we be allocating a new resource for it |
204 | * or simply enabling it? | 204 | * or simply enabling it? |
205 | */ | 205 | */ |
206 | if (!(pci_resource_flags(dev, PCI_ROM_RESOURCE) & | 206 | pci_enable_rom(dev); |
207 | IORESOURCE_ROM_ENABLE)) { | 207 | printk("%s: enabling expansion ROM\n", pci_name(dev)); |
208 | u32 val; | ||
209 | pci_resource_flags(dev, PCI_ROM_RESOURCE) |= IORESOURCE_ROM_ENABLE; | ||
210 | pci_read_config_dword(dev, PCI_ROM_ADDRESS, &val); | ||
211 | val |= PCI_ROM_ADDRESS_ENABLE; | ||
212 | pci_write_config_dword(dev, PCI_ROM_ADDRESS, val); | ||
213 | printk("%s: enabling expansion ROM\n", pci_name(dev)); | ||
214 | } | ||
215 | } | 208 | } |
216 | 209 | ||
217 | if (!len || !base) | 210 | if (!len || !base) |
@@ -232,18 +225,13 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map) | |||
232 | static void | 225 | static void |
233 | intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map) | 226 | intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map) |
234 | { | 227 | { |
235 | u32 val; | ||
236 | |||
237 | if (map->base) | 228 | if (map->base) |
238 | iounmap(map->base); | 229 | iounmap(map->base); |
239 | 230 | ||
240 | /* | 231 | /* |
241 | * We need to undo the PCI BAR2/PCI ROM BAR address alteration. | 232 | * We need to undo the PCI BAR2/PCI ROM BAR address alteration. |
242 | */ | 233 | */ |
243 | pci_resource_flags(dev, PCI_ROM_RESOURCE) &= ~IORESOURCE_ROM_ENABLE; | 234 | pci_disable_rom(dev); |
244 | pci_read_config_dword(dev, PCI_ROM_ADDRESS, &val); | ||
245 | val &= ~PCI_ROM_ADDRESS_ENABLE; | ||
246 | pci_write_config_dword(dev, PCI_ROM_ADDRESS, val); | ||
247 | } | 235 | } |
248 | 236 | ||
249 | static unsigned long | 237 | static unsigned long |