From: Stephen Warren <swarren@wwwdotorg.org>
To: "J, KEERTHY" <j-keerthy@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"broonie@kernel.org" <broonie@kernel.org>,
"ldewangan@nvidia.com" <ldewangan@nvidia.com>,
"sameo@linux.intel.com" <sameo@linux.intel.com>,
"grant.likely@secretlab.ca" <grant.likely@secretlab.ca>,
"swarren@nvidia.com" <swarren@nvidia.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"gg@slimlogic.co.uk" <gg@slimlogic.co.uk>
Subject: Re: [PATCH v2 1/4] MFD: Palmas: Check if interrupts property exists and then only request irq
Date: Tue, 18 Jun 2013 13:11:56 -0600 [thread overview]
Message-ID: <51C0B0FC.2090908@wwwdotorg.org> (raw)
In-Reply-To: <DC88CAD03C0052499C1907B327FC63229EC5DB@DBDE04.ent.ti.com>
On 06/18/2013 11:33 AM, J, KEERTHY wrote:
> Stephen Warren wrote at Tuesday, June 18, 2013 10:53 PM:
...>> No, you should just check the IRQ number.
>
> Hmmm...so something like (!i2c->irq)
Yes.
>> Consider this:
>>
>> If the device was instantiated from a board file *or* a device tree,
>> i2c->irq is correctly set. Hence, checking that value works in both
>> cases.
>>
>> If you check the interrupts DT property, that will only work if the
>> device was instantiated from device tree, and not if it was
>> instantiated from a board file; the property will never exist in the
>> board file case, and hence you'll never be able to have a board file
>> provide an interrupt.
>
> The board file approach is getting deprecated for this. I
> Myself removed board file related pdata stuff in one of the patches.
>
> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg90598.html
>
> So going the DeviceTree way.
Even if you're 100% sure this driver will only ever work with DT (which
seems like a bad assumption to make no matter what the circumstance),
it'd still be best to detect whether an IRQ was specified in a generic
way. That way, nobody will read this driver, assume the code is generic,
and just copy/paste it without thinking.
next prev parent reply other threads:[~2013-06-18 19:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 10:01 [PATCH v2 0/4] MFD: Palmas: Add TPS659038 PMIC support on Palmas J Keerthy
2013-06-18 10:01 ` J Keerthy
2013-06-18 10:01 ` [PATCH v2 1/4] MFD: Palmas: Check if interrupts property exists and then only request irq J Keerthy
2013-06-18 10:01 ` J Keerthy
2013-06-18 15:51 ` Stephen Warren
2013-06-18 16:54 ` J, KEERTHY
2013-06-18 17:08 ` Stephen Warren
2013-06-18 17:19 ` J, KEERTHY
2013-06-18 17:22 ` Stephen Warren
2013-06-18 17:33 ` J, KEERTHY
2013-06-18 19:11 ` Stephen Warren [this message]
2013-06-19 1:28 ` J, KEERTHY
2013-06-18 18:07 ` Mark Brown
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=51C0B0FC.2090908@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=broonie@kernel.org \
--cc=gg@slimlogic.co.uk \
--cc=grant.likely@secretlab.ca \
--cc=j-keerthy@ti.com \
--cc=ldewangan@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=swarren@nvidia.com \
/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.