This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / mtd / devices / pmc551.c
index c2c2a3c..1430885 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: pmc551.c,v 1.28 2004/08/09 13:19:44 dwmw2 Exp $
+ * $Id: pmc551.c,v 1.24 2003/05/20 21:03:08 dwmw2 Exp $
  *
  * PMC551 PCI Mezzanine Ram Device
  *
 #include <linux/mtd/pmc551.h>
 #include <linux/mtd/compatmac.h>
 
+#if LINUX_VERSION_CODE > 0x20300
+#define PCI_BASE_ADDRESS(dev) (dev->resource[0].start)
+#else
+#define PCI_BASE_ADDRESS(dev) (dev->base_address[0])
+#endif
+
 static struct mtd_info *pmc551list;
 
 static int pmc551_erase (struct mtd_info *mtd, struct erase_info *instr)
@@ -169,7 +175,9 @@ out:
        printk(KERN_DEBUG "pmc551_erase() done\n");
 #endif
 
-        mtd_erase_callback(instr);
+        if (instr->callback) {
+                (*(instr->callback))(instr);
+       }
         return 0;
 }
 
@@ -556,7 +564,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev)
               (size<1024)?size:(size<1048576)?size>>10:size>>20,
                (size<1024)?'B':(size<1048576)?'K':'M',
               size, ((dcmd&(0x1<<3)) == 0)?"non-":"",
-               (dev->resource[0].start)&PCI_BASE_ADDRESS_MEM_MASK );
+               PCI_BASE_ADDRESS(dev)&PCI_BASE_ADDRESS_MEM_MASK );
 
         /*
          * Check to see the state of the memory
@@ -686,7 +694,7 @@ int __init init_pmc551(void)
                 }
 
                 printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%lX\n",
-                                   PCI_Device->resource[0].start);
+                                   PCI_BASE_ADDRESS(PCI_Device));
 
                 /*
                  * The PMC551 device acts VERY weird if you don't init it
@@ -740,7 +748,7 @@ int __init init_pmc551(void)
                        printk(KERN_NOTICE "pmc551: Using specified aperture size %dM\n", asize>>20);
                        priv->asize = asize;
                }
-                priv->start = ioremap(((PCI_Device->resource[0].start)
+                priv->start = ioremap((PCI_BASE_ADDRESS(PCI_Device)
                                        & PCI_BASE_ADDRESS_MEM_MASK),
                                       priv->asize);