linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MSP71xx: request_irq() failure ignored in msp_pcibios_config_access()
@ 2009-09-01 18:32 Roel Kluin
       [not found] ` <4A9D6E37.1030704@team-embedded.nl>
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-09-01 18:32 UTC (permalink / raw)
  To: Ralf Baechle, linux-mips, Andrew Morton

Produce an error if request_irq() fails.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 109c95c..223d822 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -402,11 +402,12 @@ int msp_pcibios_config_access(unsigned char access_type,
 	 * allocation assigns an interrupt handler to the interrupt.
 	 */
 	if (pciirqflag == 0) {
-		request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */
+		if ((request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */
 				bpci_interrupt,
 				IRQF_SHARED | IRQF_DISABLED,
 				"PMC MSP PCI Host",
-				preg);
+				preg)) != 0)
+			return -1;
 		pciirqflag = ~0;
 	}
 

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

* Re: [PATCH] MSP71xx: request_irq() failure ignored in msp_pcibios_config_access()
       [not found] ` <4A9D6E37.1030704@team-embedded.nl>
@ 2009-09-01 20:23   ` Roel Kluin
  0 siblings, 0 replies; 2+ messages in thread
From: Roel Kluin @ 2009-09-01 20:23 UTC (permalink / raw)
  To: Ithamar R. Adema; +Cc: Ralf Baechle, linux-mips, Andrew Morton

Produce an error if request_irq() fails.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---

>> +            return -1;

> I'd personally suggest to return the actual value returned by
> request_irq, instead of returning -EPERM..... ;)
> 
> Ithamar.

The comments at the header states that it returns -1 on failure,
and so do the callers as well, but if preferred, below is as you
suggest.

Thanks,

diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 109c95c..32548b5 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -385,6 +385,7 @@ int msp_pcibios_config_access(unsigned char access_type,
 	unsigned long intr;
 	unsigned long value;
 	static char pciirqflag;
+	int ret;
 #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
 	unsigned int	vpe_status;
 #endif
@@ -402,11 +403,13 @@ int msp_pcibios_config_access(unsigned char access_type,
 	 * allocation assigns an interrupt handler to the interrupt.
 	 */
 	if (pciirqflag == 0) {
-		request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */
+		ret = request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */
 				bpci_interrupt,
 				IRQF_SHARED | IRQF_DISABLED,
 				"PMC MSP PCI Host",
 				preg);
+		if (ret != 0)
+			return ret;
 		pciirqflag = ~0;
 	}
 

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

end of thread, other threads:[~2009-09-01 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-01 18:32 [PATCH] MSP71xx: request_irq() failure ignored in msp_pcibios_config_access() Roel Kluin
     [not found] ` <4A9D6E37.1030704@team-embedded.nl>
2009-09-01 20:23   ` Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).