mtd: move mxcnd_remove to .exit.text
[safe/jmp/linux-2.6] / drivers / mtd / maps / pci.c
index 21822c2..48f4cf5 100644 (file)
@@ -7,8 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
- *  $Id: pci.c,v 1.14 2005/11/17 08:20:27 dwmw2 Exp $
- *
  * Generic PCI memory map driver.  We support the following boards:
  *  - Intel IQ80310 ATU.
  *  - Intel EBSA285 (blank rom programming mode). Tested working 27/09/2001
@@ -205,15 +203,8 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map)
                 * not enabled, should we be allocating a new resource for it
                 * or simply enabling it?
                 */
-               if (!(pci_resource_flags(dev, PCI_ROM_RESOURCE) &
-                                   IORESOURCE_ROM_ENABLE)) {
-                       u32 val;
-                       pci_resource_flags(dev, PCI_ROM_RESOURCE) |= IORESOURCE_ROM_ENABLE;
-                       pci_read_config_dword(dev, PCI_ROM_ADDRESS, &val);
-                       val |= PCI_ROM_ADDRESS_ENABLE;
-                       pci_write_config_dword(dev, PCI_ROM_ADDRESS, val);
-                       printk("%s: enabling expansion ROM\n", pci_name(dev));
-               }
+               pci_enable_rom(dev);
+               printk("%s: enabling expansion ROM\n", pci_name(dev));
        }
 
        if (!len || !base)
@@ -234,18 +225,13 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map)
 static void
 intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map)
 {
-       u32 val;
-
        if (map->base)
                iounmap(map->base);
 
        /*
         * We need to undo the PCI BAR2/PCI ROM BAR address alteration.
         */
-       pci_resource_flags(dev, PCI_ROM_RESOURCE) &= ~IORESOURCE_ROM_ENABLE;
-       pci_read_config_dword(dev, PCI_ROM_ADDRESS, &val);
-       val &= ~PCI_ROM_ADDRESS_ENABLE;
-       pci_write_config_dword(dev, PCI_ROM_ADDRESS, val);
+       pci_disable_rom(dev);
 }
 
 static unsigned long
@@ -334,9 +320,6 @@ mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
        return 0;
 
 release:
-       if (mtd)
-               map_destroy(mtd);
-
        if (map) {
                map->exit(dev, map);
                kfree(map);