Re: [-mm PATCH] remove use of pci_find_device in watchdog driverfor Intel 6300ESB chipset

From: Jiri Slaby
Date: Mon Aug 15 2005 - 19:20:10 EST


David Härdeman napsal(a):

On Mon, Aug 15, 2005 at 02:30:15PM -0700, Naveen Gupta wrote:
[...}

- 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++;
+ }


I'm certainly not sure about this, but the proposed while loop looks a bit unconventional, wouldn't something like:

for_each_pci_dev(dev)
if (pci_match_id(esb_pci_tbl, dev)) {
esb_pci = dev;
break;
}
}

be better?

I did it here http://lkml.org/lkml/2005/8/9/305, but it wasn't acked yet. I should repost.

--
Jiri Slaby www.fi.muni.cz/~xslaby
~\-/~ jirislaby@xxxxxxxxx ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

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