linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] platform_get_irq() return for no IRQ
@ 2004-10-20 17:40 Ben Dooks
  2004-10-22 10:10 ` Ben Dooks
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2004-10-20 17:40 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

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.

Signed-of-by: Ben Dooks <ben-linux@fluff.org>


[-- Attachment #2: plat-irq-fix.patch --]
[-- Type: text/plain, Size: 330 bytes --]

--- linux-2.6.9-bk4-orig/drivers/base/platform.c	2004-10-20 15:50:29.000000000 +0100
+++ linux-2.6.9-bk4/drivers/base/platform.c	2004-10-20 18:37:12.000000000 +0100
@@ -54,7 +54,7 @@
 {
 	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
 
-	return r ? r->start : 0;
+	return r ? r->start : -ENOENT;
 }
 
 /**

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

* Re: [PATCH/RFC] platform_get_irq() return for no IRQ
  2004-10-20 17:40 [PATCH/RFC] platform_get_irq() return for no IRQ Ben Dooks
@ 2004-10-22 10:10 ` Ben Dooks
  2004-10-22 12:25   ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2004-10-22 10:10 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-kernel

On Wed, Oct 20, 2004 at 06:40:15PM +0100, Ben Dooks wrote:
> 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.
> 
> Signed-of-by: Ben Dooks <ben-linux@fluff.org>
> 

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.

> --- linux-2.6.9-bk4-orig/drivers/base/platform.c	2004-10-20 15:50:29.000000000 +0100
> +++ linux-2.6.9-bk4/drivers/base/platform.c	2004-10-20 18:37:12.000000000 +0100
> @@ -54,7 +54,7 @@
>  {
>  	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
>  
> -	return r ? r->start : 0;
> +	return r ? r->start : -ENOENT;
>  }
>  
>  /**


-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

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

* Re: [PATCH/RFC] platform_get_irq() return for no IRQ
  2004-10-22 10:10 ` Ben Dooks
@ 2004-10-22 12:25   ` Russell King
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King @ 2004-10-22 12:25 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-kernel

On Fri, Oct 22, 2004 at 11:10:18AM +0100, Ben Dooks wrote:
> On Wed, Oct 20, 2004 at 06:40:15PM +0100, Ben Dooks wrote:
> > 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.
> > 
> > Signed-of-by: Ben Dooks <ben-linux@fluff.org>
> > 
> 
> 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)

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

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

end of thread, other threads:[~2004-10-22 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-20 17:40 [PATCH/RFC] platform_get_irq() return for no IRQ Ben Dooks
2004-10-22 10:10 ` Ben Dooks
2004-10-22 12:25   ` Russell King

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).