From: Grant Likely <grant.likely@secretlab.ca>
To: Esben Haabendal <esbenhaabendal@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org,
Andrew Morton <akpm@linux-foundation.org>,
David Brownell <dbrownell@users.sourceforge.net>,
linux-mmc@vger.kernel.org
Subject: Re: [PATCH] of_mmc_spi: add card detect irq support
Date: Mon, 30 Aug 2010 11:46:17 -0600 [thread overview]
Message-ID: <AANLkTinhctfE_BTF3xtACMoqrtRiSNApQ3+qCaOJ=w7m@mail.gmail.com> (raw)
In-Reply-To: <AANLkTik3rNpFCYDR7dxiFN_3dvxZmsSjt8PsoC415JM-@mail.gmail.com>
On Mon, Aug 30, 2010 at 10:04 AM, Esben Haabendal
<esbenhaabendal@gmail.com> wrote:
> On Mon, Aug 30, 2010 at 3:29 PM, Anton Vorontsov <cbouatmailru@gmail.com>=
wrote:
>>> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
>>> *mmc_spi_get_pdata(struct spi_device *spi)
>>> =A0 =A0 =A0 =A0 if (gpio_is_valid(oms->gpios[WP_GPIO]))
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 oms->pdata.get_ro =3D of_mmc_spi_get_ro=
;
>>>
>>> - =A0 =A0 =A0 /* We don't support interrupts yet, let's poll. */
>>> - =A0 =A0 =A0 oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL;
>>> + =A0 =A0 =A0 oms->detect_irq =3D irq_of_parse_and_map(np, 0);
>>> + =A0 =A0 =A0 if (oms->detect_irq !=3D NO_IRQ) {
>>
>> I'd write "if (oms->detect_irq)", which is a bit more natural
>> (and still correct, 0 is the only invalid VIRQ number).
>
> Most other architectures has NO_IRQ defined to -1, so I will stick
> with the NO_IRQ comparsion.
Not true. NO_IRQ is only defined as -1 on ARM, microblaze, mn10300
and parisc, and I've got a patch pending to remove microblaze from
that list. ARM just happens to be a really big user.
$ git grep NO_IRQ arch/*/include (I've trimmed the irrelevant matches)
arch/arm/include/asm/irq.h:#ifndef NO_IRQ
arch/arm/include/asm/irq.h:#define NO_IRQ ((unsigned int)(-1))
arch/microblaze/include/asm/irq.h:#define NO_IRQ (-1)
arch/mn10300/include/asm/irq.h:#define NO_IRQ INT_MAX
arch/parisc/include/asm/irq.h:#define NO_IRQ (-1)
arch/powerpc/include/asm/irq.h:#define NO_IRQ (0)
> Hopefully, arm users will soon enjoy this driver/wrapper soon also.
My hope is that even on ARM when the device tree is used I'll be able
eliminate IRQs mapped to 0 (but I need to do a lot more research on
how best to do that though). Are you actually using this on ARM?
I'm okay with you keeping the NO_IRQ test for the short term though.
g.
next prev parent reply other threads:[~2010-08-30 17:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-30 12:04 [PATCH] of_mmc_spi: add card detect irq support Esben Haabendal
2010-08-30 13:29 ` Anton Vorontsov
2010-08-30 16:04 ` Esben Haabendal
2010-08-30 16:11 ` Anton Vorontsov
2010-08-30 16:38 ` David Brownell
2010-08-30 17:49 ` Grant Likely
2010-12-28 16:05 ` Anton Vorontsov
2011-03-08 3:52 ` Grant Likely
2010-08-30 17:46 ` Grant Likely [this message]
2010-08-31 6:14 ` Esben Haabendal
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='AANLkTinhctfE_BTF3xtACMoqrtRiSNApQ3+qCaOJ=w7m@mail.gmail.com' \
--to=grant.likely@secretlab.ca \
--cc=akpm@linux-foundation.org \
--cc=dbrownell@users.sourceforge.net \
--cc=esbenhaabendal@gmail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).