[MTD] [NOR] intel_dc21285 switch to ROM API
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Sep 26 21:59:01 EDT 2008
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4ab13943612673ef0822e1a041a9e629ba13a87c
Commit: 4ab13943612673ef0822e1a041a9e629ba13a87c
Parent: e416de5e61e1a9b7f987804cbb67230b5f5293c6
Author: Alan Cox <alan at lxorguk.ukuu.org.uk>
AuthorDate: Tue Sep 23 17:25:10 2008 +0100
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Sep 26 19:00:12 2008 -0600
[MTD] [NOR] intel_dc21285 switch to ROM API
Now that the needed helpers are exported, it becomes a nice simple
switch over. Closes #9420
Signed-off-by: Alan Cox <alan at redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/maps/pci.c | 16 +++-------------
1 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
index 5c6a25c..d978c2e 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)
* 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)
@@ -240,10 +233,7 @@ intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map)
/*
* 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
More information about the linux-mtd-cvs
mailing list