platform_get_irq() return for no IRQ
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 ; }/**
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
-ENOENTinstead.Signed-of-by Ben Dooks <[email protected]>
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'
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
-ENOENTinstead.Signed-of-by Ben Dooks <[email protected]>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