Skip to contentSkip to conversation

MSP71xx: request_irq() failure ignored in msp_pcibios_config_access()

PATCH In review Roel Kluin 1 participant 2 messages Sep 1, 2009 1 message not in the archive MIPS

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 MSP71xx: request_irq() failure ignored in msp_pcibios_config_access()

Produce an error if request_irq() fails.

---

arch/mips/pci/ops-pmcmsp.c +3 -2
index 109c95c..223d822 100644
@@ -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;
 	}
 
author
#2 lore raw
In reply to a message not in the archive

Produce an error if request_irq() fails.

---

Quoted 6 lines
Quoted 1 line

+ 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,

arch/mips/pci/ops-pmcmsp.c +4 -1
index 109c95c..32548b5 100644
@@ -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;
 	}