From: Grant Likely <grant.likely@secretlab.ca>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Linuxppc-dev list <linuxppc-dev@ozlabs.org>,
devicetree-discuss <devicetree-discuss@lists.ozlabs.org>,
Prabhakar Kushwaha <prabhakar@freescale.com>
Subject: Re: checking status semantics with compatible functions
Date: Wed, 30 Mar 2011 08:31:13 -0600 [thread overview]
Message-ID: <20110330143113.GA13685@ponder.secretlab.ca> (raw)
In-Reply-To: <C1B3133E-0EEE-49E9-9E3A-35026CFA78E9@kernel.crashing.org>
On Wed, Mar 30, 2011 at 03:26:29AM -0500, Kumar Gala wrote:
> [Adding proper lists on CC]
>
> - k
>
> On Mar 30, 2011, at 3:07 AM, Kumar Gala wrote:
>
> > Grant,
> >
> > We have a few helper functions like:
> >
> > drivers/of/base.c:EXPORT_SYMBOL(of_device_is_compatible);
> > drivers/of/base.c:EXPORT_SYMBOL(of_find_compatible_node);
> >
> > That we use in places like arch/powerpc/platform/85xx/mpc85xx_ds.c:
> >
> > for_each_node_by_type(np, "pci") {
> > if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
> > of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
> > of_device_is_compatible(np, "fsl,p2020-pcie")) {
> >
> > It seems like we should check 'status' in these cases with
> > 'of_device_is_available'. I'm thinking that we should have
> > versions of the helpers that also do the 'of_device_is_available'
> > checking. Or should we just change the helpers to call
> > of_device_is_available?
Yes, of_device_is_available() should be checked, but it should not be
added directly to of_device_is_compatible(). I'm okay with adding
a helper variant that does the of_device_is_compatible() check.
In that particular case, I'd also suggest using for_each_matching_node().
g.
next prev parent reply other threads:[~2011-03-30 14:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <9BC4C90E-090F-4961-A242-10D769C08738@kernel.crashing.org>
2011-03-30 8:26 ` checking status semantics with compatible functions Kumar Gala
2011-03-30 14:31 ` Grant Likely [this message]
2011-04-05 11:59 ` Benjamin Herrenschmidt
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=20110330143113.GA13685@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=prabhakar@freescale.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 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).