diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -427,7 +427,7 @@ static unsigned int __devinit init_chips */ for (via_config = via_isa_bridges; via_config->id; via_config++) - if ((isa = pci_find_device(PCI_VENDOR_ID_VIA + + if ((isa = pci_get_device(PCI_VENDOR_ID_VIA + !!(via_config->flags & VIA_BAD_ID), via_config->id, NULL))) { @@ -435,6 +435,7 @@ static unsigned int __devinit init_chips if (t >= via_config->rev_min && t <= via_config->rev_max) break; + pci_dev_put(isa); } if (!via_config->id) { @@ -572,6 +573,8 @@ static unsigned int __devinit init_chips ide_pci_create_host_proc("via", via_get_info); via_proc = 1; } +#else + pci_dev_put(isa); #endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ return 0; } @@ -646,9 +649,18 @@ static struct pci_driver driver = { static int via_ide_init(void) { + isa_dev = NULL; return ide_pci_register_driver(&driver); } +#ifdef MODULE +static void __exit via_ide_exit() +{ + pci_dev_put(isa_dev); +} +module_exit(via_ide_exit); +#endif + module_init(via_ide_init); MODULE_AUTHOR("Vojtech Pavlik, Michel Aubry, Jeff Garzik, Andre Hedrick");