]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/maps/ichxrom.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / mtd / maps / ichxrom.c
index e505207cd4892918b27c59a3ccc2f00afc0c3c59..c32bc28920b35fe3927f960a528a52fd2f6fa5c6 100644 (file)
@@ -2,7 +2,6 @@
  * ichxrom.c
  *
  * Normal mappings of chips in physical memory
- * $Id: ichxrom.c,v 1.18 2005/07/07 10:26:20 dwmw2 Exp $
  */
 
 #include <linux/module.h>
@@ -14,7 +13,6 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/flashchip.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 #include <linux/list.h>
@@ -62,6 +60,7 @@ static void ichxrom_cleanup(struct ichxrom_window *window)
        /* Disable writes through the rom window */
        pci_read_config_word(window->pdev, BIOS_CNTL, &word);
        pci_write_config_word(window->pdev, BIOS_CNTL, word & ~1);
+       pci_dev_put(window->pdev);
 
        /* Free all of the mtd devices */
        list_for_each_entry_safe(map, scratch, &window->maps, list) {
@@ -101,7 +100,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
         * you can only really attach a FWH to an ICHX there
         * a number of simplifications you can make.
         *
-        * Also you can page firmware hubs if an 8MB window isn't enough 
+        * Also you can page firmware hubs if an 8MB window isn't enough
         * but don't currently handle that case either.
         */
        window->pdev = pdev;
@@ -144,7 +143,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
                window->phys = 0xfff00000;
        }
        else if ((byte & 0x80) == 0x80) {
-               window->phys = 0xfff80000; 
+               window->phys = 0xfff80000;
        }
 
        if (window->phys == 0) {
@@ -177,9 +176,10 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
                window->rsrc.parent = NULL;
                printk(KERN_DEBUG MOD_NAME
                        ": %s(): Unable to register resource"
-                       " 0x%.08lx-0x%.08lx - kernel bug?\n",
+                       " 0x%.16llx-0x%.16llx - kernel bug?\n",
                        __func__,
-                       window->rsrc.start, window->rsrc.end);
+                       (unsigned long long)window->rsrc.start,
+                       (unsigned long long)window->rsrc.end);
        }
 
        /* Map the firmware hub into my address space. */
@@ -226,14 +226,14 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
                        (((unsigned long)(window->virt)) + offset);
                map->map.size = 0xffffffffUL - map_top + 1UL;
                /* Set the name of the map to the address I am trying */
-               sprintf(map->map_name, "%s @%08lx",
-                       MOD_NAME, map->map.phys);
+               sprintf(map->map_name, "%s @%08Lx",
+                       MOD_NAME, (unsigned long long)map->map.phys);
 
                /* Firmware hubs only use vpp when being programmed
                 * in a factory setting.  So in-place programming
                 * needs to use a different method.
                 */
-               for(map->map.bankwidth = 32; map->map.bankwidth; 
+               for(map->map.bankwidth = 32; map->map.bankwidth;
                        map->map.bankwidth >>= 1)
                {
                        char **probe_type;
@@ -258,8 +258,8 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
                /* Trim the size if we are larger than the map */
                if (map->mtd->size > map->map.size) {
                        printk(KERN_WARNING MOD_NAME
-                               " rom(%u) larger than window(%lu). fixing...\n",
-                               map->mtd->size, map->map.size);
+                               " rom(%llu) larger than window(%lu). fixing...\n",
+                               (unsigned long long)map->mtd->size, map->map.size);
                        map->mtd->size = map->map.size;
                }
                if (window->rsrc.parent) {
@@ -286,7 +286,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
                for(i = 0; i < cfi->numchips; i++) {
                        cfi->chips[i].start += offset;
                }
-               
+
                /* Now that the mtd devices is complete claim and export it */
                map->mtd->owner = THIS_MODULE;
                if (add_mtd_device(map->mtd)) {
@@ -306,9 +306,8 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
 
  out:
        /* Free any left over map structures */
-       if (map) {
-               kfree(map);
-       }
+       kfree(map);
+
        /* See if I have any map structures */
        if (list_empty(&window->maps)) {
                ichxrom_cleanup(window);
@@ -325,11 +324,11 @@ static void __devexit ichxrom_remove_one (struct pci_dev *pdev)
 }
 
 static struct pci_device_id ichxrom_pci_tbl[] __devinitdata = {
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, 
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,
          PCI_ANY_ID, PCI_ANY_ID, },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, 
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,
          PCI_ANY_ID, PCI_ANY_ID, },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, 
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,
          PCI_ANY_ID, PCI_ANY_ID, },
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0,
          PCI_ANY_ID, PCI_ANY_ID, },
@@ -356,7 +355,7 @@ static int __init init_ichxrom(void)
 
        pdev = NULL;
        for (id = ichxrom_pci_tbl; id->vendor; id++) {
-               pdev = pci_find_device(id->vendor, id->device, NULL);
+               pdev = pci_get_device(id->vendor, id->device, NULL);
                if (pdev) {
                        break;
                }