[WATCHDOG] removes pci_find_device from i6300esb.c
authorJiri Slaby <xslaby@fi.muni.cz>
Wed, 17 Aug 2005 07:09:13 +0000 (09:09 +0200)
committerWim Van Sebroeck <wim@iguana.be>
Sun, 11 Sep 2005 19:43:02 +0000 (21:43 +0200)
This patch changes pci_find_device to pci_get_device
(encapsulated in for_each_pci_dev) in i6300esb watchdog
card with appropriate adding pci_dev_put.

Generated in 2.6.13-rc5-mm1 kernel version.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/char/watchdog/i6300esb.c

index 87273839aead254383688b7c8104a3f9be664a17..20ceb5fe28b6d575dccb92bc1560cb88ea4d2d94 100644 (file)
@@ -368,12 +368,11 @@ static unsigned char __init esb_getdevice (void)
          *      Find the PCI device
          */
 
-        while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+        for_each_pci_dev(dev)
                 if (pci_match_device(esb_pci_tbl, dev)) {
                         esb_pci = dev;
                         break;
                 }
-        }
 
         if (esb_pci) {
                if (pci_enable_device(esb_pci)) {
@@ -430,6 +429,7 @@ err_release:
                pci_release_region(esb_pci, 0);
 err_disable:
                pci_disable_device(esb_pci);
+               pci_dev_put(esb_pci);
        }
 out:
        return 0;
@@ -481,6 +481,7 @@ err_unmap:
        pci_release_region(esb_pci, 0);
 /* err_disable: */
        pci_disable_device(esb_pci);
+       pci_dev_put(esb_pci);
 /* out: */
         return ret;
 }
@@ -497,6 +498,7 @@ static void __exit watchdog_cleanup (void)
        iounmap(BASEADDR);
        pci_release_region(esb_pci, 0);
        pci_disable_device(esb_pci);
+       pci_dev_put(esb_pci);
 }
 
 module_init(watchdog_init);