From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Claudiu Manoil <claudiu.manoil@freescale.com>,
Grant Likely <grant.likely@linaro.org>,
"open list:OPEN FIRMWARE AND..." <devicetree@vger.kernel.org>,
Pawel Moll <pawel.moll@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Richard Cochran <richardcochran@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Aida Mynzhasova <aida.mynzhasova@skitlab.ru>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
Randy Dunlap <rdunlap@infradead.org>,
open list <linux-kernel@vger.kernel.org>,
davem@davemlof.net, Vitaly Bordug <vbordug@ru.mvista.com>,
Kumar Gala <galak@codeaurora.org>,
"open list:LINUX FOR POWERPC..." <linuxppc-dev@lists.ozlabs.org>,
David S.
Subject: [PATCH net-next 7/9] ucc_geth: use the new fixed PHY helpers
Date: Mon, 19 May 2014 17:56:22 -0700 [thread overview]
Message-ID: <1400547384-11363-8-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1400547384-11363-1-git-send-email-f.fainelli@gmail.com>
of_phy_connect_fixed_link() is becoming obsolete, and also required
platform code to register the fixed PHYs at the specified addresses for
those to be usable. Get rid of it and use the new of_phy_is_fixed_link()
plus of_phy_register_fixed_link() helpers to transition over the new
scheme.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/freescale/ucc_geth.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index c8299c31b21f..fab39e295441 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -1728,9 +1728,6 @@ static int init_phy(struct net_device *dev)
phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0,
priv->phy_interface);
- if (!phydev)
- phydev = of_phy_connect_fixed_link(dev, &adjust_link,
- priv->phy_interface);
if (!phydev) {
dev_err(&dev->dev, "Could not attach to PHY\n");
return -ENODEV;
@@ -3790,6 +3787,17 @@ static int ucc_geth_probe(struct platform_device* ofdev)
ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0);
+ if (!ug_info->phy_node) {
+ /* In the case of a fixed PHY, the DT node associated
+ * to the PHY is the Ethernet MAC DT node.
+ */
+ if (of_phy_is_fixed_link(np)) {
+ err = of_phy_register_fixed_link(np);
+ if (err)
+ return err;
+ }
+ ug_info->phy_node = np;
+ }
/* Find the TBI PHY node. If it's not there, we don't support SGMII */
ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
--
1.9.1
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
next prev parent reply other threads:[~2014-05-20 0:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 0:56 [PATCH 0/9 net-next] net: of_phy_connect_fixed_link removal Florian Fainelli
2014-05-20 0:56 ` [PATCH net-next 1/9] Documentation: devicetree: add old and deprecated 'fixed-link' Florian Fainelli
2014-05-20 0:56 ` [PATCH net-next 2/9] Documentation: devicetree: net: refer to fixed-link.txt Florian Fainelli
2014-05-20 0:56 ` [PATCH net-next 3/9] net: bcmgenet: use the new fixed PHY helpers Florian Fainelli
2014-05-20 0:56 ` [PATCH net-next 4/9] net: systemport: " Florian Fainelli
2014-05-20 0:56 ` [PATCH net-next 5/9] fs_enet: " Florian Fainelli
2014-05-20 0:56 ` [PATCH net-next 6/9] gianfar: " Florian Fainelli
2014-05-20 0:56 ` Florian Fainelli [this message]
2014-05-20 0:56 ` [PATCH net-next 8/9] of: mdio: remove of_phy_connect_fixed_link Florian Fainelli
2014-05-20 0:56 ` [PATCH net-next 9/9] powerpc/fsl: fsl_soc: remove 'fixed-link' parsing code Florian Fainelli
2014-05-20 16:13 ` [PATCH 0/9 net-next] net: of_phy_connect_fixed_link removal Florian Fainelli
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=1400547384-11363-8-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=aida.mynzhasova@skitlab.ru \
--cc=claudiu.manoil@freescale.com \
--cc=davem@davemlof.net \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
--cc=pawel.moll@arm.com \
--cc=rdunlap@infradead.org \
--cc=richardcochran@gmail.com \
--cc=robh+dt@kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=vbordug@ru.mvista.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).