From: Naveen Gupta <ngupta@google.com>
To: wim@iguana.be, david@2gen.com, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [-mm PATCH] remove use of pci_find_device in watchdog driver for Intel 6300ESB chipset
Date: Mon, 15 Aug 2005 14:30:15 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.56.0508151425320.27212@krishna.corp.google.com> (raw)
This patch replaces obsolete 'pci_find_device' with 'pci_get_device' to
prevent the device from being stolen under us in Watchdog timer driver
for intel 6300ESB chipset.
Signed-off-by: Naveen Gupta <ngupta@google.com>
Index: linux-2.6.12/drivers/char/watchdog/i6300esb.c
===================================================================
--- linux-2.6.12.orig/drivers/char/watchdog/i6300esb.c 2005-08-15 11:28:07.000000000 -0700
+++ linux-2.6.12/drivers/char/watchdog/i6300esb.c 2005-08-15 11:36:54.000000000 -0700
@@ -362,23 +362,24 @@
{
u8 val1;
unsigned short val2;
-
+ struct pci_device_id *ids = esb_pci_tbl;
struct pci_dev *dev = NULL;
/*
* Find the PCI device
*/
- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
- if (pci_match_id(esb_pci_tbl, dev)) {
- esb_pci = dev;
- break;
- }
- }
+ while (ids->vendor && ids->device) {
+ if ((dev = pci_get_device(ids->vendor, ids->device, dev)) != NULL) {
+ esb_pci = dev;
+ break;
+ }
+ ids++;
+ }
if (esb_pci) {
if (pci_enable_device(esb_pci)) {
printk (KERN_ERR PFX "failed to enable device\n");
- goto out;
+ goto err_devput;
}
if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) {
@@ -430,8 +431,9 @@
pci_release_region(esb_pci, 0);
err_disable:
pci_disable_device(esb_pci);
+err_devput:
+ pci_dev_put(esb_pci);
}
-out:
return 0;
}
@@ -481,7 +483,8 @@
pci_release_region(esb_pci, 0);
/* err_disable: */
pci_disable_device(esb_pci);
-/* out: */
+/* err_devput: */
+ pci_dev_put(esb_pci);
return ret;
}
@@ -497,6 +500,7 @@
iounmap(BASEADDR);
pci_release_region(esb_pci, 0);
pci_disable_device(esb_pci);
+ pci_dev_put(esb_pci);
}
module_init(watchdog_init);
next reply other threads:[~2005-08-15 21:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-15 21:30 Naveen Gupta [this message]
2005-08-15 23:14 ` David Härdeman
2005-08-16 0:19 ` 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=Pine.LNX.4.56.0508151425320.27212@krishna.corp.google.com \
--to=ngupta@google.com \
--cc=akpm@osdl.org \
--cc=david@2gen.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wim@iguana.be \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®