X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fpci.c;h=d2ab1bae9c346fbf2168ff59199222f226e6f2cb;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=8b5d1ff45755995733df6f9ef039edfa3c5fae52;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index 8b5d1ff45..d2ab1bae9 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c @@ -7,8 +7,8 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * $Id: pci.c,v 1.8 2004/07/12 22:38:29 dwmw2 Exp $ - * + * $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 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -33,11 +34,11 @@ struct mtd_pci_info { struct map_pci_info { struct map_info map; - void *base; + void __iomem *base; void (*exit)(struct pci_dev *dev, struct map_pci_info *map); unsigned long (*translate)(struct map_pci_info *map, unsigned long ofs); struct pci_dev *dev; -}; +}; static map_word mtd_pci_read8(struct map_info *_map, unsigned long ofs) { @@ -101,7 +102,7 @@ static void mtd_pci_copyto(struct map_info *_map, unsigned long to, const void * memcpy_toio(map->base + map->translate(map, to), from, len); } -static struct map_info mtd_pci_map = { +static const struct map_info mtd_pci_map = { .phys = NO_XIP, .copy_from = mtd_pci_copyfrom, .copy_to = mtd_pci_copyto, @@ -143,7 +144,7 @@ static void intel_iq80310_exit(struct pci_dev *dev, struct map_pci_info *map) { if (map->base) - iounmap((void *)map->base); + iounmap(map->base); pci_write_config_dword(dev, 0x44, map->map.map_priv_2); } @@ -205,9 +206,9 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map) * or simply enabling it? */ if (!(pci_resource_flags(dev, PCI_ROM_RESOURCE) & - PCI_ROM_ADDRESS_ENABLE)) { + IORESOURCE_ROM_ENABLE)) { u32 val; - pci_resource_flags(dev, PCI_ROM_RESOURCE) |= PCI_ROM_ADDRESS_ENABLE; + 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); @@ -236,12 +237,12 @@ intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map) u32 val; if (map->base) - iounmap((void *)map->base); + iounmap(map->base); /* * We need to undo the PCI BAR2/PCI ROM BAR address alteration. */ - pci_resource_flags(dev, PCI_ROM_RESOURCE) &= ~PCI_ROM_ADDRESS_ENABLE; + 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); @@ -333,9 +334,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); @@ -370,7 +368,7 @@ static struct pci_driver mtd_pci_driver = { static int __init mtd_pci_maps_init(void) { - return pci_module_init(&mtd_pci_driver); + return pci_register_driver(&mtd_pci_driver); } static void __exit mtd_pci_maps_exit(void)