public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Jon Smirl <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
	i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH] mpc i2c driver, compare to NO_IRQ instead of zero
Date: Fri, 2 May 2008 16:46:10 +0200	[thread overview]
Message-ID: <20080502164610.277ec04b@hyperion.delvare> (raw)
In-Reply-To: <9e4733910805020723p7900c132j872893113f9d739e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Jon,

On Fri, 2 May 2008 10:23:01 -0400, Jon Smirl wrote:
> On 2/19/08, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> >  >       i2c->irq = platform_get_irq(pdev, 0);
> >  > -     if (i2c->irq < 0) {
> >  > +     if (i2c->irq < NO_IRQ) {
> >
> >
> > I am skeptical about this one. Can platform_get_irq() really return
> >  NO_IRQ? I thought that the IRQ resource would be plain missing if the
> >  device has no IRQ, so I would expect:
> >
> >
> >         i2c->irq = platform_get_irq(pdev, 0);
> >         if (i2c->irq < 0)
> >
> >                 i2c->irq = NO_IRQ; /* Use polling */
> >
> >  Testing against NO_IRQ suggests that devices with no IRQ would still
> >  have an IRQ resource defined and explicitly set to NO_IRQ. Sounds weird
> >  to me. Can you please clarify this point?
> 
> Your fix is correct. I'm not sure polling worked in the original driver.

OK, can you send an updated patch then?

Thanks.

> >  For what it's worth, no other kernel driver checks for irq < NO_IRQ.
> >  They all check for irq < 0 after calling platform_get_irq().
> >
> >
> >  >               result = -ENXIO;
> >  >               goto fail_get_irq;
> >  >       }

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-05-02 14:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-21 20:07 [PATCH] mpc i2c driver, compare to NO_IRQ instead of zero Jon Smirl
2008-01-24 22:32 ` [i2c] " Jon Smirl
     [not found]   ` <9e4733910801241432r4424d41ayd5e41e57bc3e052b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-01-24 22:35     ` Benjamin Herrenschmidt
2008-01-24 23:07       ` Jon Smirl
     [not found] ` <20080121200740.13800.20524.stgit-+J+k29bDNxlBDLzU/O5InQ@public.gmane.org>
2008-01-25 17:13   ` Jon Smirl
2008-02-19 16:42   ` Jean Delvare
2008-04-25  9:43     ` Jean Delvare
2008-05-02 14:23     ` Jon Smirl
     [not found]       ` <9e4733910805020723p7900c132j872893113f9d739e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-02 14:46         ` Jean Delvare [this message]
2008-05-02 16:02           ` Jon Smirl
2008-05-02 16:29             ` Jean Delvare
     [not found]               ` <20080502182917.41dc560e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-05-02 17:19                 ` Jon Smirl
     [not found]                   ` <9e4733910805021019t6fb94ed0m63a82ba7103c0202-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-02 20:27                     ` Jean Delvare

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=20080502164610.277ec04b@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox