diff options
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/pmc551.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 62a918895df4..354e1657cc26 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c | |||
@@ -568,8 +568,7 @@ static u32 fixup_pmc551(struct pci_dev *dev) | |||
568 | size >> 10 : size >> 20, | 568 | size >> 10 : size >> 20, |
569 | (size < 1024) ? 'B' : (size < 1048576) ? 'K' : 'M', size, | 569 | (size < 1024) ? 'B' : (size < 1048576) ? 'K' : 'M', size, |
570 | ((dcmd & (0x1 << 3)) == 0) ? "non-" : "", | 570 | ((dcmd & (0x1 << 3)) == 0) ? "non-" : "", |
571 | (unsigned long long)((dev->resource[0].start) & | 571 | (unsigned long long)pci_resource_start(dev, 0)); |
572 | PCI_BASE_ADDRESS_MEM_MASK)); | ||
573 | 572 | ||
574 | /* | 573 | /* |
575 | * Check to see the state of the memory | 574 | * Check to see the state of the memory |
@@ -705,7 +704,7 @@ static int __init init_pmc551(void) | |||
705 | } | 704 | } |
706 | 705 | ||
707 | printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%llx\n", | 706 | printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%llx\n", |
708 | (unsigned long long)PCI_Device->resource[0].start); | 707 | (unsigned long long)pci_resource_start(PCI_Device, 0)); |
709 | 708 | ||
710 | /* | 709 | /* |
711 | * The PMC551 device acts VERY weird if you don't init it | 710 | * The PMC551 device acts VERY weird if you don't init it |
@@ -762,9 +761,7 @@ static int __init init_pmc551(void) | |||
762 | "size %dM\n", asize >> 20); | 761 | "size %dM\n", asize >> 20); |
763 | priv->asize = asize; | 762 | priv->asize = asize; |
764 | } | 763 | } |
765 | priv->start = ioremap(((PCI_Device->resource[0].start) | 764 | priv->start = pci_iomap(PCI_Device, 0, priv->asize); |
766 | & PCI_BASE_ADDRESS_MEM_MASK), | ||
767 | priv->asize); | ||
768 | 765 | ||
769 | if (!priv->start) { | 766 | if (!priv->start) { |
770 | printk(KERN_NOTICE "pmc551: Unable to map IO space\n"); | 767 | printk(KERN_NOTICE "pmc551: Unable to map IO space\n"); |
@@ -805,7 +802,7 @@ static int __init init_pmc551(void) | |||
805 | if (add_mtd_device(mtd)) { | 802 | if (add_mtd_device(mtd)) { |
806 | printk(KERN_NOTICE "pmc551: Failed to register new " | 803 | printk(KERN_NOTICE "pmc551: Failed to register new " |
807 | "device\n"); | 804 | "device\n"); |
808 | iounmap(priv->start); | 805 | pci_iounmap(PCI_Device, priv->start); |
809 | kfree(mtd->priv); | 806 | kfree(mtd->priv); |
810 | kfree(mtd); | 807 | kfree(mtd); |
811 | break; | 808 | break; |
@@ -856,7 +853,7 @@ static void __exit cleanup_pmc551(void) | |||
856 | if (priv->start) { | 853 | if (priv->start) { |
857 | printk(KERN_DEBUG "pmc551: unmapping %dM starting at " | 854 | printk(KERN_DEBUG "pmc551: unmapping %dM starting at " |
858 | "0x%p\n", priv->asize >> 20, priv->start); | 855 | "0x%p\n", priv->asize >> 20, priv->start); |
859 | iounmap(priv->start); | 856 | pci_iounmap(priv->dev, priv->start); |
860 | } | 857 | } |
861 | pci_dev_put(priv->dev); | 858 | pci_dev_put(priv->dev); |
862 | 859 | ||