From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Tony Lindgren" <tony@atomide.com>,
"Benoît Cousson" <b-cousson@ti.com>,
"Russell King" <linux@arm.linux.org.uk>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Enric Balletbo i Serra" <eballetbo@gmail.com>,
"Ezequiel Garcia" <ezequiel.garcia@free-electrons.com>,
devicetree-discuss@lists.ozlabs.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Grant Likely" <grant.likely@secretlab.ca>
Subject: Re: [PATCH RFC 1/7] platform: add a device node
Date: Sun, 10 Feb 2013 02:49:21 +0100 [thread overview]
Message-ID: <5116FCA1.40703@collabora.co.uk> (raw)
In-Reply-To: <20130210010246.GA1455@kroah.com>
Hi Greg,
Thanks a lot for your feedback.
On 02/10/2013 02:02 AM, Greg Kroah-Hartman wrote:
> On Sat, Feb 09, 2013 at 09:44:25PM +0100, Javier Martinez Canillas wrote:
>> When using Device Trees, it is necessary to associate a
>> device node with a platform device.
>>
>> Usually this device node has to used in the device probe
>> function (e.g: to initizalize the pinctrl pads assocaited
>> with the device).
>>
>> So, platform code needs to pass a device node as a platform
>> device info to the platform device registration function.
>
> Really? We don't already have enough other pointers in the platform
> device structure that we need another one?
>
I knew this would be controversial and that's why I didn't mean it to be a patch
but a RFC :)
The problem basically is that you have to associate the platform device with its
corresponding DT device node because it can be used in the driver probe function.
But you can't do this before calling platform_device_register_resndata() since
the platform_device has not been allocated yet and you can't do it after since
by then the driver probe function has been executed already.
You could certainly pass the device node as a platform device resource by for
example storing the dev node pointer in the struct resource .start member or by
adding it to the structure (struct smsc911x_platform_config in this case) that
gets copied to the struct platform_device_info void *data.
Then in the driver probe function you could get the device node from either the
platform_data or a dev->resource.
But I expect most users of platform_device_register_resndata() will have a
similar issue as more and more platform drivers are migrated to DT.
So, to avoid each driver to do the same (encode and decode the DT device node
using platform_data or a device resource) I thought that it could make sense to
add yet another pointer to the struct platform_device_info structure and set:
pdev->dev.of_node = pdevinfo->of_node
inside platform_device_register_full().
> I don't buy it, sorry. Any reason you didn't run this by Grant as well?
>
No reason at all, it is just me being goofy. I thought that Grant was cc'ed
already and I just realized that he wasn't. cc'ing him as well.
> greg k-h
>
Thanks a lot and best regards,
Javier
next prev parent reply other threads:[~2013-02-10 1:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-09 20:44 [PATCH RFC 0/7] ARM: OMAP: add DT binding for gpmc-smsc911x Javier Martinez Canillas
2013-02-09 20:44 ` [PATCH RFC 1/7] platform: add a device node Javier Martinez Canillas
2013-02-10 1:02 ` Greg Kroah-Hartman
2013-02-10 1:49 ` Javier Martinez Canillas [this message]
2013-02-10 9:37 ` Russell King - ARM Linux
2013-02-10 11:35 ` Javier Martinez Canillas
2013-02-11 8:16 ` Sascha Hauer
2013-02-11 10:33 ` Javier Martinez Canillas
2013-02-11 11:24 ` Sascha Hauer
2013-02-11 11:38 ` Javier Martinez Canillas
2013-02-18 13:51 ` Grant Likely
2013-02-18 13:56 ` Javier Martinez Canillas
2013-02-18 13:33 ` Grant Likely
2013-02-09 20:44 ` [PATCH RFC 2/7] net: smsc911x: add pinctrl support Javier Martinez Canillas
2013-02-11 14:23 ` Linus Walleij
2013-02-11 14:29 ` Javier Martinez Canillas
2013-02-09 20:44 ` [PATCH RFC 3/7] ARM: OMAP: gpmc-smsc911x: add DT dev node init function Javier Martinez Canillas
2013-02-11 10:30 ` Mark Rutland
2013-02-11 10:40 ` Javier Martinez Canillas
2013-02-09 20:44 ` [PATCH RFC 4/7] ARM: OMAP: gpmc-smsc911x: pass a dev node to platform registration Javier Martinez Canillas
2013-02-09 20:44 ` [PATCH RFC 5/7] ARM: OMAP: gpmc: add support for gpmc-smsc911x child nodes Javier Martinez Canillas
2013-02-09 20:44 ` [PATCH RFC 6/7] ARM: dts: OMAP: Add an GPMC node for OMAP3 Javier Martinez Canillas
2013-02-09 20:44 ` [PATCH RFC 7/7] ARM: dts: omap3-igep0020: Add SMSC911x LAN chip support Javier Martinez Canillas
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=5116FCA1.40703@collabora.co.uk \
--to=javier.martinez@collabora.co.uk \
--cc=b-cousson@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=eballetbo@gmail.com \
--cc=ezequiel.garcia@free-electrons.com \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=tony@atomide.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).