From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>, netdev@vger.kernel.org
Cc: horms+renesas@verge.net.au, linux-sh@vger.kernel.org,
magnus@opensource.se, linux-kernel@lists.codethink.co.uk
Subject: Re: [PATCH] sh_eth: call of_mdiobus_register() to register phys
Date: Mon, 17 Feb 2014 15:40:07 +0000 [thread overview]
Message-ID: <53023B60.4030201@cogentembedded.com> (raw)
In-Reply-To: <1392650895-1422-1-git-send-email-ben.dooks@codethink.co.uk>
Hello.
On 02/17/2014 06:28 PM, Ben Dooks wrote:
> If the sh_eth device is registered using OF, then the driver
Which is not supported yet as my DT patch hasn't been merged.
This patch seems somewhat premature.
> should call of_mdiobus_register() to register any PHYs connected
> to the system.
That's not necessary (but good to have).
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/net/ethernet/renesas/sh_eth.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 06970ac..165f0c4 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2629,6 +2630,18 @@ static int sh_mdio_init(struct net_device *ndev, int id,
> snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
> mdp->pdev->name, id);
>
> + if (ndev->dev.parent->of_node) {
> + dev_set_drvdata(&ndev->dev, mdp->mii_bus);
> + ret = of_mdiobus_register(mdp->mii_bus,
> + ndev->dev.parent->of_node);
> + if (ret != 0) {
> + dev_err(&ndev->dev, "of_mdiobus_register() failed\n");
> + goto out_free_bus;
> + }
> +
> + return 0;
> + }
> +
> /* PHY IRQ */
> mdp->mii_bus->irq = devm_kzalloc(&ndev->dev,
> sizeof(int) * PHY_MAX_ADDR,
>
Hm, I can only hope this works with PHY IRQ in DT mode.
Would you mind if I include your patch into my Ether DT patch?
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>, netdev@vger.kernel.org
Cc: horms+renesas@verge.net.au, linux-sh@vger.kernel.org,
magnus@opensource.se, linux-kernel@lists.codethink.co.uk
Subject: Re: [PATCH] sh_eth: call of_mdiobus_register() to register phys
Date: Mon, 17 Feb 2014 19:40:00 +0300 [thread overview]
Message-ID: <53023B60.4030201@cogentembedded.com> (raw)
In-Reply-To: <1392650895-1422-1-git-send-email-ben.dooks@codethink.co.uk>
Hello.
On 02/17/2014 06:28 PM, Ben Dooks wrote:
> If the sh_eth device is registered using OF, then the driver
Which is not supported yet as my DT patch hasn't been merged.
This patch seems somewhat premature.
> should call of_mdiobus_register() to register any PHYs connected
> to the system.
That's not necessary (but good to have).
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/net/ethernet/renesas/sh_eth.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 06970ac..165f0c4 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2629,6 +2630,18 @@ static int sh_mdio_init(struct net_device *ndev, int id,
> snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
> mdp->pdev->name, id);
>
> + if (ndev->dev.parent->of_node) {
> + dev_set_drvdata(&ndev->dev, mdp->mii_bus);
> + ret = of_mdiobus_register(mdp->mii_bus,
> + ndev->dev.parent->of_node);
> + if (ret != 0) {
> + dev_err(&ndev->dev, "of_mdiobus_register() failed\n");
> + goto out_free_bus;
> + }
> +
> + return 0;
> + }
> +
> /* PHY IRQ */
> mdp->mii_bus->irq = devm_kzalloc(&ndev->dev,
> sizeof(int) * PHY_MAX_ADDR,
>
Hm, I can only hope this works with PHY IRQ in DT mode.
Would you mind if I include your patch into my Ether DT patch?
WBR, Sergei
next prev parent reply other threads:[~2014-02-17 15:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 15:28 [PATCH] sh_eth: call of_mdiobus_register() to register phys Ben Dooks
2014-02-17 15:40 ` Sergei Shtylyov [this message]
2014-02-17 16:40 ` Sergei Shtylyov
2014-02-17 15:46 ` Ben Dooks
2014-02-17 16:44 ` [Linux-kernel] " Ben Dooks
2014-02-18 15:38 ` Sergei Shtylyov
2014-02-18 16:38 ` Sergei Shtylyov
2014-02-18 16:00 ` Ben Dooks
2014-02-18 17:11 ` Sergei Shtylyov
2014-02-18 18:11 ` Sergei Shtylyov
2014-02-18 17:39 ` Ben Dooks
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=53023B60.4030201@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=ben.dooks@codethink.co.uk \
--cc=horms+renesas@verge.net.au \
--cc=linux-kernel@lists.codethink.co.uk \
--cc=linux-sh@vger.kernel.org \
--cc=magnus@opensource.se \
--cc=netdev@vger.kernel.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 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.