From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 4/9] GPIO: gpio-pxa: simplify pxa_gpio_to_irq() and pxa_irq_to_chip()
Date: Mon, 06 Aug 2012 10:11:33 +0200 [thread overview]
Message-ID: <501F7C35.7040409@gmail.com> (raw)
In-Reply-To: <201208060809.15527.arnd@arndb.de>
On 06.08.2012 10:09, Arnd Bergmann wrote:
> On Sunday 05 August 2012, Linus Walleij wrote:
>>>>>
>>>>> +#ifdef CONFIG_ARCH_PXA
>>>>> + if (gpio_is_pxa_type(gpio_type))
>>>>> + irq_base = PXA_GPIO_TO_IRQ(0);
>>>>> +#endif
>>>>> +#ifdef CONFIG_ARCH_MMP
>>>>> + if (gpio_is_mmp_type(gpio_type))
>>>>> + irq_base = MMP_GPIO_TO_IRQ(0);
>>>>> +#endif
>>>>
>>>> Grrr. Can we think of a way to get rid of these #ifdef:s?
>>>>
>>>
>>> It's used for non-DT mode. This driver is used in both arch-pxa
>>> and arch-mmp. Since we use static irq allocation in non-DT mode,
>>> we have to use this kind of code to get irq_base.
>>>
>>> What Daniel did is only simplifying the code.
>>
>> Yep I know, and the result is better than without the patch, so
>> I Acked it. But if I have my dreams come true we could do away
>> with this compile-time stuff as well...
>
> I think the real solution for these is to merge ARCH_PXA and ARCH_MMP
> and move all the code into one directory. I think it's ok to have
> the above hack in there in the meantime as long as we can agree on where
> we're heading eventually.
I don't know how much work that would be but I agree that it would
definitiely be nicer, yes. Note, however, that there was a lot more
#ifdef hackery in that driver before the cleanup.
Daniel
next prev parent reply other threads:[~2012-08-06 8:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-28 10:07 [PATCH v3 0/9] Assorted PXA3xx DT patches Daniel Mack
2012-07-28 10:07 ` [PATCH v3 1/9] RTC: add DT bindings to pxa-rtc Daniel Mack
2012-07-28 10:07 ` [PATCH v3 2/9] MMC: pxa-mci: add DT bindings Daniel Mack
2012-08-03 23:52 ` Chris Ball
2012-08-04 1:30 ` Haojian Zhuang
2012-07-28 10:07 ` [PATCH v3 3/9] MTD: pxa3xx-nand: add devicetree bindings Daniel Mack
2012-07-28 10:07 ` [PATCH v3 4/9] GPIO: gpio-pxa: simplify pxa_gpio_to_irq() and pxa_irq_to_chip() Daniel Mack
2012-08-05 0:12 ` Linus Walleij
2012-08-05 2:56 ` Haojian Zhuang
2012-08-05 9:37 ` Linus Walleij
2012-08-06 8:09 ` Arnd Bergmann
2012-08-06 8:11 ` Daniel Mack [this message]
2012-07-28 10:07 ` [PATCH v3 5/9] GPIO: gpio-pxa: fix devicetree functions Daniel Mack
2012-08-04 23:40 ` Linus Walleij
2012-08-05 2:58 ` Haojian Zhuang
2012-07-28 10:07 ` [PATCH v3 6/9] ARM: pxa: add devicetree code for irq handling Daniel Mack
2012-07-28 10:07 ` [PATCH v3 7/9] ARM: pxa3xx: skip default device initialization when booting via DT Daniel Mack
2012-07-28 10:07 ` [PATCH v3 8/9] ARM: pxa3xx: add generic DT machine code Daniel Mack
2012-07-28 10:07 ` [PATCH v3 9/9] ARM: pxa: add .dtsi files Daniel Mack
2012-07-28 18:42 ` Amar Nath
2012-07-29 0:02 ` Daniel Mack
2012-07-29 19:05 ` Daniel Mack
2012-07-29 13:04 ` [PATCH v3 0/9] Assorted PXA3xx DT patches Arnd Bergmann
2012-07-30 14:01 ` Haojian Zhuang
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=501F7C35.7040409@gmail.com \
--to=zonque@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).