* [PATCH 2.6] hw_random.c: replace pci_find_device
@ 2004-10-21 18:38 Hanna Linder
2004-10-21 22:48 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Hanna Linder @ 2004-10-21 18:38 UTC (permalink / raw)
To: lkml, kernel-janitors; +Cc: greg, hannal, jgarzik
As pci_find_device is going away I've replaced it with pci_get_device.
for_each_pci_dev is a macro wrapper around pci_get_device.
If someone with this hardware could test it I would appreciate it.
Thanks.
Hanna Linder
IBM Linux Technology Center
Signed-off-by: Hanna Linder <hannal@us.ibm.com>
---
diff -Nrup linux-2.6.9cln/drivers/char/hw_random.c linux-2.6.9patch3/drivers/char/hw_random.c
--- linux-2.6.9cln/drivers/char/hw_random.c 2004-10-18 16:35:53.000000000 -0700
+++ linux-2.6.9patch3/drivers/char/hw_random.c 2004-10-20 14:52:42.000000000 -0700
@@ -581,7 +581,7 @@ static int __init rng_init (void)
DPRINTK ("ENTER\n");
/* Probe for Intel, AMD RNGs */
- while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+ for_each_pci_dev(pdev) {
ent = pci_match_device (rng_pci_tbl, pdev);
if (ent) {
rng_ops = &rng_vendor_ops[ent->driver_data];
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 2.6] hw_random.c: replace pci_find_device 2004-10-21 18:38 [PATCH 2.6] hw_random.c: replace pci_find_device Hanna Linder @ 2004-10-21 22:48 ` Jeff Garzik 2004-10-25 16:48 ` Jon Smirl 2004-10-25 16:59 ` Chris Wright 0 siblings, 2 replies; 5+ messages in thread From: Jeff Garzik @ 2004-10-21 22:48 UTC (permalink / raw) To: Hanna Linder; +Cc: lkml, kernel-janitors, greg applied ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6] hw_random.c: replace pci_find_device 2004-10-21 22:48 ` Jeff Garzik @ 2004-10-25 16:48 ` Jon Smirl 2004-10-25 17:10 ` [KJ] " Nishanth Aravamudan 2004-10-25 16:59 ` Chris Wright 1 sibling, 1 reply; 5+ messages in thread From: Jon Smirl @ 2004-10-25 16:48 UTC (permalink / raw) To: Jeff Garzik; +Cc: Hanna Linder, lkml, kernel-janitors, greg On Thu, 21 Oct 2004 18:48:58 -0400, Jeff Garzik <jgarzik@pobox.com> wrote: > applied I just pulled from Linus bk, for_each_pci_dev isn't defined anywhere. I get compile errors in hw_random.c. [jonsmirl@smirl linux-2.5]$ grep -rI for_each_pci_dev * drivers/char/hw_random.c: for_each_pci_dev(pdev) { SCCS/s.ChangeSet:\x01c for_each_pci_dev is a macro wrapper around pci_get_device. [jonsmirl@smirl linux-2.5]$ -- Jon Smirl jonsmirl@gmail.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [KJ] Re: [PATCH 2.6] hw_random.c: replace pci_find_device 2004-10-25 16:48 ` Jon Smirl @ 2004-10-25 17:10 ` Nishanth Aravamudan 0 siblings, 0 replies; 5+ messages in thread From: Nishanth Aravamudan @ 2004-10-25 17:10 UTC (permalink / raw) To: Jon Smirl; +Cc: Jeff Garzik, kernel-janitors, lkml, Hanna Linder, greg On Mon, Oct 25, 2004 at 12:48:43PM -0400, Jon Smirl wrote: > On Thu, 21 Oct 2004 18:48:58 -0400, Jeff Garzik <jgarzik@pobox.com> wrote: > > applied > > I just pulled from Linus bk, for_each_pci_dev isn't defined anywhere. > I get compile errors in hw_random.c. > > [jonsmirl@smirl linux-2.5]$ grep -rI for_each_pci_dev * > drivers/char/hw_random.c: for_each_pci_dev(pdev) { > SCCS/s.ChangeSet:\x01c for_each_pci_dev is a macro wrapper around pci_get_device. > [jonsmirl@smirl linux-2.5]$ I believe some people missed Hanna's first patch which defined for_each_pci_dev so she sent it again a few days after. Here is her message again... -Nish ------- I wrote this macro last week and was recently asked to resend it in case people missed the original submission. I have been using it during my conversion to pci_get_device and it seems to be fine. Hanna Linder IBM Linux Technology Center Signed-off-by: Hanna Linder <hannal@us.ibm.com> --- diff -Nrup linux-2.6.9-rc3-mm2cln/include/linux/pci.h linux-2.6.9-rc3-mm2patch/include/linux/pci.h --- linux-2.6.9-rc3-mm2cln/include/linux/pci.h 2004-10-04 11:38:51.000000000 -0700 +++ linux-2.6.9-rc3-mm2patch/include/linux/pci.h 2004-10-05 15:56:26.000000000 -0700 @@ -548,6 +548,7 @@ struct pci_dev { #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) #define to_pci_dev(n) container_of(n, struct pci_dev, dev) +#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) /* * For PCI devices, the region numbers are assigned this way: ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6] hw_random.c: replace pci_find_device 2004-10-21 22:48 ` Jeff Garzik 2004-10-25 16:48 ` Jon Smirl @ 2004-10-25 16:59 ` Chris Wright 1 sibling, 0 replies; 5+ messages in thread From: Chris Wright @ 2004-10-25 16:59 UTC (permalink / raw) To: Jeff Garzik; +Cc: Hanna Linder, lkml, kernel-janitors, greg * Jeff Garzik (jgarzik@pobox.com) wrote: > applied CC drivers/char/hw_random.o drivers/char/hw_random.c: In function `rng_init': drivers/char/hw_random.c:584: warning: implicit declaration of function `for_each_pci_dev' ... Woops, looks like this broke the build, I don't have for_each_pci_dev anywhere in my tree but one use in hw_random.c and one comment in SCCS/s.ChangeSet. thanks, -chris -- Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-10-25 17:13 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-10-21 18:38 [PATCH 2.6] hw_random.c: replace pci_find_device Hanna Linder 2004-10-21 22:48 ` Jeff Garzik 2004-10-25 16:48 ` Jon Smirl 2004-10-25 17:10 ` [KJ] " Nishanth Aravamudan 2004-10-25 16:59 ` Chris Wright
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome