X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Famd76xrom.c;h=447955be18af771b32df85d3678d6b8c9ab596cc;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=51e97b05304e4ee37f5bf8a6e3d0b3e0269cde8b;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c index 51e97b053..447955be1 100644 --- a/drivers/mtd/maps/amd76xrom.c +++ b/drivers/mtd/maps/amd76xrom.c @@ -2,7 +2,7 @@ * amd76xrom.c * * Normal mappings of chips in physical memory - * $Id: amd76xrom.c,v 1.19 2004/11/28 09:40:39 dwmw2 Exp $ + * $Id: amd76xrom.c,v 1.21 2005/11/07 11:14:26 gleixner Exp $ */ #include @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -70,7 +69,7 @@ static void amd76xrom_cleanup(struct amd76xrom_window *window) list_del(&map->list); kfree(map); } - if (window->rsrc.parent) + if (window->rsrc.parent) release_resource(&window->rsrc); if (window->virt) { @@ -107,7 +106,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev, window->phys = 0xffff0000; /* 64KiB */ } window->size = 0xffffffffUL - window->phys + 1UL; - + /* * Try to reserve the window mem region. If this fails then * it is likely due to a fragment of the window being @@ -123,9 +122,10 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev, window->rsrc.parent = NULL; printk(KERN_ERR 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); } #if 0 @@ -138,7 +138,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev, /* Enable writes through the rom window */ pci_read_config_byte(pdev, 0x40, &byte); pci_write_config_byte(pdev, 0x40, byte | 1); - + /* FIXME handle registers 0x80 - 0x8C the bios region locks */ /* For write accesses caches are useless */ @@ -186,7 +186,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev, MOD_NAME, map->map.phys); /* There is no generic VPP support */ - for(map->map.bankwidth = 32; map->map.bankwidth; + for(map->map.bankwidth = 32; map->map.bankwidth; map->map.bankwidth >>= 1) { char **probe_type; @@ -239,7 +239,7 @@ static int __devinit amd76xrom_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)) { @@ -259,9 +259,7 @@ static int __devinit amd76xrom_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)) { amd76xrom_cleanup(window); @@ -279,9 +277,9 @@ static void __devexit amd76xrom_remove_one (struct pci_dev *pdev) } static struct pci_device_id amd76xrom_pci_tbl[] = { - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7410, + { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7410, PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7440, + { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7440, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_AMD, 0x7468 }, /* amd8111 support */ { 0, } @@ -314,7 +312,7 @@ static int __init init_amd76xrom(void) } return -ENXIO; #if 0 - return pci_module_init(&amd76xrom_driver); + return pci_register_driver(&amd76xrom_driver); #endif }