Re: Create new function to see if pci dev is present

From: Greg KH
Date: Tue Sep 28 2004 - 12:29:06 EST


On Tue, Sep 28, 2004 at 10:24:26AM -0700, Greg KH wrote:
> Ok, here's the patch that I applied to my trees, and I'll follow this up
> with a conversion of Hanna's two patches that I respun to use the new
> parameters of this function.

Here's the irq.c patch:

----------

PCI: change irq.c to use pci_dev_present

Signed-off-by: Hanna Linder <hannal@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>

diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
--- a/arch/i386/pci/irq.c 2004-09-28 10:21:40 -07:00
+++ b/arch/i386/pci/irq.c 2004-09-28 10:21:40 -07:00
@@ -452,21 +452,17 @@

#endif

-
static __init int intel_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{
- struct pci_dev *dev1, *dev2;
+ static struct pci_device_id pirq_440gx[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_2) },
+ { },
+ };

/* 440GX has a proprietary PIRQ router -- don't use it */
- dev1 = pci_get_device(PCI_VENDOR_ID_INTEL,
- PCI_DEVICE_ID_INTEL_82443GX_0, NULL);
- dev2 = pci_get_device(PCI_VENDOR_ID_INTEL,
- PCI_DEVICE_ID_INTEL_82443GX_2, NULL);
- if ((dev1 != NULL) || (dev2 != NULL)) {
- pci_dev_put(dev1);
- pci_dev_put(dev2);
+ if (pci_dev_present(pirq_440gx))
return 0;
- }

switch(device)
{
-
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/