Skip to content

Commit

Permalink
[WATCHDOG] removes pci_find_device from i6300esb.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Wim Van Sebroeck committed Sep 11, 2005
1 parent cc90ef0 commit c69af03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/char/watchdog/i6300esb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -430,6 +429,7 @@ static unsigned char __init esb_getdevice (void)
pci_release_region(esb_pci, 0);
err_disable:
pci_disable_device(esb_pci);
pci_dev_put(esb_pci);
}
out:
return 0;
Expand Down Expand Up @@ -481,6 +481,7 @@ static int __init watchdog_init (void)
pci_release_region(esb_pci, 0);
/* err_disable: */
pci_disable_device(esb_pci);
pci_dev_put(esb_pci);
/* out: */
return ret;
}
Expand All @@ -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);
Expand Down

0 comments on commit c69af03

Please sign in to comment.