From foo@baz Tue Apr 9 12:12:43 2002 To: Greg KH Date: 14 Sep 2004 14:23:06 -07:00 From: greg@kroah.com Subject: PCI: fix up __iomem mess in the PCI rom code. Signed-off-by: Greg Kroah-Hartman diff -Nru a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c --- a/drivers/pci/pci-sysfs.c 2004-10-06 09:44:27 -07:00 +++ b/drivers/pci/pci-sysfs.c 2004-10-06 09:44:27 -07:00 @@ -182,7 +182,7 @@ pci_read_rom(struct kobject *kobj, char *buf, loff_t off, size_t count) { struct pci_dev *pdev = to_pci_dev(container_of(kobj, struct device, kobj)); - unsigned char *rom; + void __iomem *rom; size_t size; rom = pci_map_rom(pdev, &size); /* size starts out as PCI window size */ diff -Nru a/drivers/pci/rom.c b/drivers/pci/rom.c --- a/drivers/pci/rom.c 2004-10-06 09:44:27 -07:00 +++ b/drivers/pci/rom.c 2004-10-06 09:44:27 -07:00 @@ -60,12 +60,12 @@ * the shadow BIOS copy will be returned instead of the * actual ROM. */ -unsigned char * -pci_map_rom(struct pci_dev *pdev, size_t *size) +void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) { struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; loff_t start; - unsigned char *rom, *image; + void __iomem *rom; + void __iomem *image; int last_image; if (res->flags & IORESOURCE_ROM_SHADOW) { /* IORESOURCE_ROM_SHADOW only set on x86 */ @@ -74,7 +74,7 @@ } else { if (res->flags & IORESOURCE_ROM_COPY) { *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); - return (unsigned char *)pci_resource_start(pdev, PCI_ROM_RESOURCE); + return (void __iomem *)pci_resource_start(pdev, PCI_ROM_RESOURCE); } else { /* assign the ROM an address if it doesn't have one */ if (res->parent == NULL) @@ -103,7 +103,7 @@ /* True size is important if the ROM is going to be copied. */ image = rom; do { - char *pds; + void __iomem *pds; /* Standard PCI ROMs start out with these bytes 55 AA */ if (readb(image) != 0x55) break; @@ -139,11 +139,10 @@ * the shadow BIOS copy will be returned instead of the * actual ROM. */ -unsigned char * -pci_map_rom_copy(struct pci_dev *pdev, size_t *size) +void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size) { struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; - unsigned char *rom; + void __iomem *rom; rom = pci_map_rom(pdev, size); if (!rom) @@ -157,11 +156,11 @@ return rom; res->end = res->start + *size; - memcpy((void*)res->start, rom, *size); + memcpy_fromio((void*)res->start, rom, *size); pci_unmap_rom(pdev, rom); res->flags |= IORESOURCE_ROM_COPY; - return (unsigned char *)res->start; + return (void __iomem *)res->start; } /** @@ -172,7 +171,7 @@ * Remove a mapping of a previously mapped ROM */ void -pci_unmap_rom(struct pci_dev *pdev, unsigned char *rom) +pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) { struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; diff -Nru a/include/linux/pci.h b/include/linux/pci.h --- a/include/linux/pci.h 2004-10-06 09:44:27 -07:00 +++ b/include/linux/pci.h 2004-10-06 09:44:27 -07:00 @@ -777,9 +777,9 @@ int pci_assign_resource(struct pci_dev *dev, int i); /* ROM control related routines */ -unsigned char *pci_map_rom(struct pci_dev *pdev, size_t *size); -unsigned char *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); -void pci_unmap_rom(struct pci_dev *pdev, unsigned char *rom); +void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size); +void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); +void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); void pci_remove_rom(struct pci_dev *pdev); /* Power management related routines */