summaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/i6300esb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/watchdog/i6300esb.c')
-rw-r--r--drivers/char/watchdog/i6300esb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/watchdog/i6300esb.c b/drivers/char/watchdog/i6300esb.c
index 8727383..20ceb5f 100644
--- a/drivers/char/watchdog/i6300esb.c
+++ b/drivers/char/watchdog/i6300esb.c
@@ -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);
OpenPOWER on IntegriCloud