All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: david@2gen.com, Andrew Morton <akpm@osdl.org>
Subject: [PATCH -mm] i6300esb.c uses pci_find_device
Date: Mon, 08 Aug 2005 12:34:11 +0200	[thread overview]
Message-ID: <42F73523.80205@gmail.com> (raw)

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);



             reply	other threads:[~2005-08-08 10:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 10:34 Jiri Slaby [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42F73523.80205@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@osdl.org \
    --cc=david@2gen.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.