Skip to contentSkip to conversation

pata-rb532-cf: platform_get_irq() failure ignored

PATCH In review [email protected] 2 participants 2 messages May 12, 2009 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pata-rb532-cf: platform_get_irq() failure ignored

From: Roel Kluin <[email protected]>

platform_get_irq() can return -ENXIO, but since 'irq' is an unsigned int, it does not show when the IRQ resource wasn't found.

---

 drivers/ata/pata_rb532_cf.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/ata/pata_rb532_cf.c renamed from drivers/ata/pata_rb532_cf.c~pata-rb532-cf-platform_get_irq-failure-ignored +3 -2
diff -puN drivers/ata/pata_rb532_cf.c~pata-rb532-cf-platform_get_irq-failure-ignored drivers/ata/pata_rb532_cf.c
@@ -117,11 +117,12 @@ static __devinit int rb532_pata_driver_p
 		return -EINVAL;
 	}
 
-	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	ret = platform_get_irq(pdev, 0);
+	if (ret <= 0) {
 		dev_err(&pdev->dev, "no IRQ resource found\n");
 		return -ENOENT;
 	}
+	irq = ret;
 
 	gpio = irq_to_gpio(irq);
 	if (gpio < 0) {

_

#1 lore raw

Hi!

Quoted 4 lines · On Tue, May 12, 2009 at 01:44:58PM -0700, [email protected] wrote:

From: Roel Kluin <[email protected]>

platform_get_irq() can return -ENXIO, but since 'irq' is an unsigned int, it does not show when the IRQ resource wasn't found.

This no longer applies, as 'irq' is signed now. See Jeff's email to this list (Message-ID: [email protected]), in which he accepts an appropriate patch by Florian Fainelli.

Greetings, Phil