All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <dvrabel@arcom.com>
To: Greg KH <gregkh@suse.de>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Russell King <rmk@arm.linux.org.uk>
Subject: Re: [DRIVER CORE] platform_get_irq*(): return   NO_IRQ on error
Date: Thu, 05 Jan 2006 18:03:10 +0000	[thread overview]
Message-ID: <43BD5F5E.1070108@arcom.com> (raw)
In-Reply-To: <20060105173717.GA11279@suse.de>

Greg KH wrote:
> On Thu, Jan 05, 2006 at 05:11:42PM +0000, David Vrabel wrote:
> 
>>platform_get_irq*() cannot return 0 on error as 0 is a valid IRQ on some
>>platforms, return NO_IRQ (-1) instead.
>>
>>Signed-off-by: David Vrabel <dvrabel@arcom.com>
>>
>>--- linux-2.6-working.orig/drivers/base/platform.c	2006-01-05 16:49:23.000000000 +0000
>>+++ linux-2.6-working/drivers/base/platform.c	2006-01-05 17:10:18.000000000 +0000
>>@@ -59,7 +59,7 @@
>> {
>> 	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
>> 
>>-	return r ? r->start : 0;
>>+	return r ? r->start : NO_IRQ;
> 
> 
> No, I think the whole NO_IRQ stuff has been given up on, see the lkml
> archives for details.

Now that you mention it I remember that thread[1].

How about returning -ENXIO (or similar) then?

I went through all the users of platform_get_irq*() and some of them
assume < 0 is an error, some of them think 0 is an error, some of them
think 0 means there's no IRQ available, some of them use NO_IRQ, and
some don't even check and just pass the result to request_irq().

[1] http://lkml.org/lkml/2005/11/21/200
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/

  reply	other threads:[~2006-01-05 18:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-05 17:11 [DRIVER CORE] platform_get_irq*(): return NO_IRQ on error David Vrabel
2006-01-05 17:26 ` Russell King
2006-01-05 17:37 ` Greg KH
2006-01-05 18:03   ` David Vrabel [this message]
2006-01-05 18:08     ` Greg KH
2006-01-19 17:49       ` [patch 0/2] driver core: platform_get_irq*(): return -ENXIO " David Vrabel
2006-01-19 17:52         ` [patch 1/2] " David Vrabel
2006-01-19 17:56         ` [patch 2/2] handle errors returned by platform_get_irq*() David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43BD5F5E.1070108@arcom.com \
    --to=dvrabel@arcom.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.