lkml.org 
[lkml]   [2005]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm] removes pci_find_device from i6300esb.c
On Tue, Aug 09, 2005 at 11:28:16AM +0200, Jiri Slaby wrote:
> Andrew Morton napsal(a):
>
> >Jiri Slaby <jirislaby@gmail.com> wrote:
> >
> >
> >>--- 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);
> >>
> >>
> >
> >That doesn't look right. Each iteration of for_each_pci_dev() needs a
> >pci_dev_put(), not just the final one.

Not true, see the documentation for pci_get_device(), it's only required
if you break out of the loop.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-10 00:01    [W:0.053 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site