public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* (no subject)
@ 2005-11-21  1:14 Matthew Wilcox
  2005-11-21  1:22 ` [PATCH 2/5] Introduce PCI_NO_IRQ and pci_valid_irq() Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2005-11-21  1:14 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Matthew Wilcox, Ingo Molnar, linux-kernel, Greg Kroah-Hartman,
	linux-pci

Subject: [PATCH 2/5] Introduce PCI_NO_IRQ and pci_valid_irq()

Explicitly initialise pci_dev->irq with PCI_NO_IRQ, allowing us to change
the value of PCI_NO_IRQ once all drivers have been audited.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Acked-by: Ingo Molnar <mingo@elte.hu>

---

 drivers/pci/probe.c |    7 +++++--
 include/linux/pci.h |    9 +++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

applies-to: 48ad7d3f9b055a9d4c1a1ab1f6dd0a584cfed99c
53424f050aff8200f80f4d3edf9af7b7f085e6f6
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index fce2cb2..35ba70b 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -571,9 +571,12 @@ static void pci_read_irq(struct pci_dev 
 	unsigned char irq;
 
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq);
-	if (irq)
+	if (irq) {
 		pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
-	dev->irq = irq;
+		dev->irq = irq;
+	} else {
+		dev->irq = PCI_NO_IRQ;
+	}
 }
 
 /**
diff --git a/include/linux/pci.h b/include/linux/pci.h
index de690ca..69cdd00 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -140,6 +140,15 @@ struct pci_dev {
 	struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
 };
 
+/*
+ * The PCI subsystem has traditionally filled in 0 when no interrupt has been
+ * assigned.  While we should move to using NO_IRQ instead, many drivers
+ * remain to be converted.  Once all drivers are using PCI_NO_IRQ, switching
+ * over should be a simple search-and-replace.
+ */
+#define PCI_NO_IRQ		0
+#define pci_valid_irq(irq)	(irq != PCI_NO_IRQ)
+
 #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)
---
0.99.8.GIT

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/5] Introduce PCI_NO_IRQ and pci_valid_irq()
  2005-11-21  1:14 Matthew Wilcox
@ 2005-11-21  1:22 ` Greg KH
  2005-11-21  2:09   ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2005-11-21  1:22 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Linus Torvalds, Andrew Morton, Ingo Molnar, linux-kernel,
	Greg Kroah-Hartman, linux-pci

On Sun, Nov 20, 2005 at 08:14:07PM -0500, Matthew Wilcox wrote:
> Explicitly initialise pci_dev->irq with PCI_NO_IRQ, allowing us to change
> the value of PCI_NO_IRQ once all drivers have been audited.

And what will the value of PCI_NO_IRQ going to be?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/5] Introduce PCI_NO_IRQ and pci_valid_irq()
  2005-11-21  1:22 ` [PATCH 2/5] Introduce PCI_NO_IRQ and pci_valid_irq() Greg KH
@ 2005-11-21  2:09   ` Matthew Wilcox
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2005-11-21  2:09 UTC (permalink / raw)
  To: Greg KH
  Cc: Linus Torvalds, Andrew Morton, Ingo Molnar, linux-kernel,
	Greg Kroah-Hartman, linux-pci

On Sun, Nov 20, 2005 at 05:22:56PM -0800, Greg KH wrote:
> On Sun, Nov 20, 2005 at 08:14:07PM -0500, Matthew Wilcox wrote:
> > Explicitly initialise pci_dev->irq with PCI_NO_IRQ, allowing us to change
> > the value of PCI_NO_IRQ once all drivers have been audited.
> 
> And what will the value of PCI_NO_IRQ going to be?

It's actually going to go away; s/PCI_NO_IRQ/NO_IRQ/g.  I didn't want to
break all the drivers immediately.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-21  2:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-21  1:14 Matthew Wilcox
2005-11-21  1:22 ` [PATCH 2/5] Introduce PCI_NO_IRQ and pci_valid_irq() Greg KH
2005-11-21  2:09   ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox