From: Grant Likely <grant.likely@secretlab.ca>
To: Gary Thomas <gary@mlbassoc.com>
Cc: Linux PPC Development <linuxppc-dev@ozlabs.org>
Subject: Re: OF device mappings
Date: Sat, 28 Feb 2009 11:44:37 -0700 [thread overview]
Message-ID: <fa686aa40902281044l3b910866g7467131db80c87e7@mail.gmail.com> (raw)
In-Reply-To: <49A9809D.9000307@mlbassoc.com>
On Sat, Feb 28, 2009 at 11:21 AM, Gary Thomas <gary@mlbassoc.com> wrote:
> Grant Likely wrote:
>> Once you have a handle to the node, you can iterate through the
>> of_platform bus devices and look for a node which has a matching node
>> pointer stored in archdata. =A0That will give you a struct device which
>> is contained by a struct of_device (note well: this will give you an
>> of_device, not a platform_device.)
>
> I have code which does this already, but I could not figure out
> how to get from the of_device node to the actual platform_device.
You can't. There is no platform_device. There is only the of_device.
The bit that you're missing is that the 'platform bus' isn't being
used at all for these devices. The 'of_platform bus' is used instead.
platform bus and of_platform bus perform essentially the same job,
but the of_platform bus differs in the way it probes drivers.
Specifically, an of_platform_driver can be handed a list of values
that it will match against, and it has a 1:1 relationship with a node
in the device tree.
> How do I find the platform_device which was created when this
> particular of_device was instantiated? =A0I made sure that this code
> is run late - after all the of_devices have been handled.
Again, there is no platform_device. of_device *is* the device that was cre=
ated.
g.
next prev parent reply other threads:[~2009-02-28 18:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-28 17:46 OF device mappings Gary Thomas
2009-02-28 18:04 ` Grant Likely
2009-02-28 18:21 ` Gary Thomas
2009-02-28 18:44 ` Grant Likely [this message]
2009-02-28 19:18 ` Gary Thomas
2009-02-28 20:19 ` Grant Likely
2009-02-28 20:25 ` Gary Thomas
2009-02-28 21:05 ` 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=fa686aa40902281044l3b910866g7467131db80c87e7@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=gary@mlbassoc.com \
--cc=linuxppc-dev@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).