From: Grant Likely <grant.likely@secretlab.ca>
To: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>, netdev@vger.kernel.org
Cc: devicetree-discuss@lists.ozlabs.org, davem@davemloft.net
Subject: Re: [PATCH 3.7.0-rc4] of/net/mdio-gpio: Fix pdev->id issue when using devicetrees.
Date: Thu, 15 Nov 2012 16:59:49 +0000 [thread overview]
Message-ID: <20121115165949.942993E194B@localhost> (raw)
In-Reply-To: <1352816773-17837-1-git-send-email-srinivas.kandagatla@st.com>
On Tue, 13 Nov 2012 14:26:13 +0000, Srinivas KANDAGATLA <srinivas.kandagatla@st.com> wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> When the mdio-gpio driver is probed via device trees, the platform
> device id is set as -1, However the id is re-used in the code while
> creating an mdio bus.
> So, setting up the id via aliases from device tree is a sensible
> solution to fix this issue.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> ---
> .../devicetree/bindings/net/mdio-gpio.txt | 9 ++++++++-
> drivers/net/phy/mdio-gpio.c | 1 +
> 2 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/mdio-gpio.txt b/Documentation/devicetree/bindings/net/mdio-gpio.txt
> index bc95495..c79bab0 100644
> --- a/Documentation/devicetree/bindings/net/mdio-gpio.txt
> +++ b/Documentation/devicetree/bindings/net/mdio-gpio.txt
> @@ -8,9 +8,16 @@ gpios property as described in section VIII.1 in the following order:
>
> MDC, MDIO.
>
> +Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases"
> +node.
> +
> Example:
>
> -mdio {
> +aliases {
> + mdio-gpio0 = <&mdio0>;
> +};
> +
> +mdio0: mdio {
> compatible = "virtual,mdio-gpio";
> #address-cells = <1>;
> #size-cells = <0>;
> diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
> index 899274f..e3f3115 100644
> --- a/drivers/net/phy/mdio-gpio.c
> +++ b/drivers/net/phy/mdio-gpio.c
> @@ -56,6 +56,7 @@ static void *mdio_gpio_of_get_data(struct platform_device *pdev)
> if (ret < 0)
> return NULL;
> pdata->mdio = ret;
> + pdev->id = of_alias_get_id(np, "mdio-gpio");
This is actually illegal. Once a device is registered, pdev->id must not
be changed. Same goes for pdev->name and pdev->dev.platform_data.
g.
next prev parent reply other threads:[~2012-11-15 16:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 14:26 [PATCH 3.7.0-rc4] of/net/mdio-gpio: Fix pdev->id issue when using devicetrees Srinivas KANDAGATLA
2012-11-14 23:59 ` David Miller
2012-11-16 9:54 ` Srinivas KANDAGATLA
2012-11-15 16:59 ` Grant Likely [this message]
[not found] ` <1352816773-17837-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2012-11-16 10:33 ` [PATCH v2 " Srinivas KANDAGATLA
2012-11-19 23:58 ` David Miller
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=20121115165949.942993E194B@localhost \
--to=grant.likely@secretlab.ca \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=srinivas.kandagatla@st.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).