Skip to contentSkip to conversation

platform_get_irq() return for no IRQ

PATCH/RFC Ben Dooks 2 participants 3 messages Oct 20, 2004 – Oct 22, 2004 Driver core

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

in drivers/base/platform.c, platform_get_irq() returns 0 if there is no IRQ found in the resources, however 0 is a valid IRQ on at least some of the ARM architectures.

This patch changes the return code to be -ENOENT instead.

drivers/base/platform.c +1 -1
@@ -54,7 +54,7 @@
 {
 	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
 
-	return r ? r->start : 0;
+	return r ? r->start : -ENOENT;
 }
 
 /**
author
#1 lore raw
Quoted 8 lines · Ben Dooks

in drivers/base/platform.c, platform_get_irq() returns 0 if there is no IRQ found in the resources, however 0 is a valid IRQ on at least some of the ARM architectures.

This patch changes the return code to be -ENOENT instead.

I should have also pointed out that as few things are actually using this at the moment, it would be a good idea to get this changed as soon as possible.

Quoted 11 lines
drivers/base/platform.c +1 -1
@@ -54,7 +54,7 @@
 {
 	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
 
-	return r ? r->start : 0;
+	return r ? r->start : -ENOENT;
 }
 
 /**
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#2 lore raw
Quoted 5 lines · Ben Dooks
Quoted 4 lines · Ben Dooks

in drivers/base/platform.c, platform_get_irq() returns 0 if there is no IRQ found in the resources, however 0 is a valid IRQ on at least some of the ARM architectures.

Quoted 8 lines
Quoted 4 lines

This patch changes the return code to be -ENOENT instead.

I should have also pointed out that as few things are actually using this at the moment, it would be a good idea to get this changed as soon as possible.

A better solution would be to make it return NO_IRQ. There's been some discussions recently about having this implemented across all platforms, and that's what stopped me submitting the version which used this macro back when this was merged. (the fact that NO_IRQ is not defined by everyone)

Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core