linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Genoud <richard.genoud@gmail.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: spi-devel-general@lists.sourceforge.net,
	"David Brownell" <dbrownell@users.sourceforge.net>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] spi_imx.c: CSPI3 irq is 0 on imx25
Date: Thu, 6 Jan 2011 12:26:17 +0100	[thread overview]
Message-ID: <AANLkTimpTUz_Fizef09urPBR8vP80KU-5yApjzGWFwc0@mail.gmail.com> (raw)
In-Reply-To: <20101223185921.GB20384@angua.secretlab.ca>

2010/12/23 Grant Likely <grant.likely@secretlab.ca>:
> On Thu, Dec 23, 2010 at 12:12:09PM +0100, Richard Genoud wrote:
>> On imx25 soc, MX25_INT_CSPI3 is 0
>> (cf arch/arm/plat-mxc/include/mach/mx25.h).
>> So, the test (spi_imx->irq <= 0) returned an error
>> for this platform.
>> This patch corrects this behaviour.
>>
>> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
>> ---
>>  drivers/spi/spi_imx.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
>> index 55a38e2..793ae99 100644
>> --- a/drivers/spi/spi_imx.c
>> +++ b/drivers/spi/spi_imx.c
>> @@ -847,7 +847,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
>>       }
>>
>>       spi_imx->irq = platform_get_irq(pdev, 0);
>> -     if (spi_imx->irq <= 0) {
>> +     if (spi_imx->irq < 0) {
>
> I *really* don't want to apply this.  The kernel is slowly moving
> toward NO_IRQ == 0 for all architectures.  This patch is a step in the
> wrong direction because it will break with ARM starts using 0 for
> NO_IRQ.
>
> I would accept a change to spi_imx->irq == NO_IRQ however.
>
> g.
>

Actually, the description of the patch is wrong, but not the patch itself.
The test "if (spi_imx->irq <= 0)" is not testing the IRQ value, but
the return value of platform_get_irq().
And platform_get_irq() can return an error (-ENXIO) or the IRQ value it found.
So, as we are testing if platform_get_irq() failed or not, the test
should be "if (spi_imx->irq < 0)"

If you agree with that, I will resend the patch with a good description.

richard.


-- 
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?

  reply	other threads:[~2011-01-06 11:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23 11:12 [PATCH 1/2] spi_imx.c: CSPI3 irq is 0 on imx25 Richard Genoud
2010-12-23 11:12 ` [PATCH 2/2] spi_imx.c: TRIVIAL mx25 & mx35 SPI_VER is 0.7 Richard Genoud
2010-12-23 14:29   ` Uwe Kleine-König
2010-12-23 14:38     ` Richard Genoud
2010-12-23 19:03     ` Grant Likely
2010-12-23 19:01   ` Grant Likely
2010-12-23 18:59 ` [PATCH 1/2] spi_imx.c: CSPI3 irq is 0 on imx25 Grant Likely
2011-01-06 11:26   ` Richard Genoud [this message]
2011-01-07 14:26     ` [PATCH] spi_imx.c: correct the test on platform_get_irq() return value Richard Genoud
2011-01-07 15:26       ` Grant Likely
2011-01-07 16:41         ` Richard Genoud
2011-01-07 16:58       ` Grant Likely

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=AANLkTimpTUz_Fizef09urPBR8vP80KU-5yApjzGWFwc0@mail.gmail.com \
    --to=richard.genoud@gmail.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).