public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm] i6300esb.c uses pci_find_device
@ 2005-08-08 10:34 Jiri Slaby
  2005-08-08 23:55 ` [PATCH -mm] removes pci_find_device from i6300esb.c Jiri Slaby
  0 siblings, 1 reply; 14+ messages in thread
From: Jiri Slaby @ 2005-08-08 10:34 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: david, Andrew Morton

This patch changes pci_find_device to pci_get_device (encapsulated in for_each_pci_dev)
with appropriate adding pci_dev_put.

Generated in 2.6.13-rc5-mm1

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

diff --git a/drivers/char/watchdog/i6300esb.c b/drivers/char/watchdog/i6300esb.c
--- a/drivers/char/watchdog/i6300esb.c
+++ b/drivers/char/watchdog/i6300esb.c
@@ -368,12 +368,11 @@ static unsigned char __init esb_getdevic
          *      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_id(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 (voi
 	iounmap(BASEADDR);
 	pci_release_region(esb_pci, 0);
 	pci_disable_device(esb_pci);
+	pci_dev_put(esb_pci);
 }
 
 module_init(watchdog_init);



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-08-16  4:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-08 10:34 [PATCH -mm] i6300esb.c uses pci_find_device Jiri Slaby
2005-08-08 23:55 ` [PATCH -mm] removes pci_find_device from i6300esb.c Jiri Slaby
2005-08-09  5:59   ` Greg KH
2005-08-09 16:06     ` Jiri Slaby
2005-08-09 23:37       ` Greg KH
2005-08-10  0:09         ` [PATCH 0/2] pci_find_device patches Jiri Slaby
2005-08-10  0:09         ` [PATCH -mm 1/2] removes pci_find_device from i6300esb.c Jiri Slaby
2005-08-16  0:24           ` [PATCH] " Jiri Slaby
2005-08-16  0:28             ` Greg KH
2005-08-10  0:09         ` [PATCH 2/2] removes pci_find_device from parport_pc.c Jiri Slaby
2005-08-09  6:34   ` [PATCH -mm] removes pci_find_device from i6300esb.c Andrew Morton
2005-08-09  9:28     ` Jiri Slaby
2005-08-09 21:56       ` Greg KH
2005-08-09  9:53     ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox