From: Sascha Hauer <s.hauer@pengutronix.de>
To: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, shawn.guo@linaro.org,
davem@davemloft.net, Sascha Hauer <s.hauer@pengutronix.de>
Subject: [PATCH 1/2] net: fec: refactor dt probing
Date: Mon, 21 Jan 2013 09:37:54 +0100 [thread overview]
Message-ID: <1358757475-21035-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1358757475-21035-1-git-send-email-s.hauer@pengutronix.de>
For devicetree parsing only the fec_get_phy_mode_dt() is
available. Rename it to fec_probe_dt() to be able to add more devicetree
parsing to it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/ethernet/freescale/fec.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 0704bca..2f86557 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1484,12 +1484,14 @@ static int fec_enet_init(struct net_device *ndev)
}
#ifdef CONFIG_OF
-static int fec_get_phy_mode_dt(struct platform_device *pdev)
+static int fec_probe_dt(struct fec_enet_private *fep)
{
- struct device_node *np = pdev->dev.of_node;
+ struct device_node *np = fep->pdev->dev.of_node;
- if (np)
- return of_get_phy_mode(np);
+ if (!np)
+ return -ENODEV;
+
+ fep->phy_interface = of_get_phy_mode(np);
return -ENODEV;
}
@@ -1519,7 +1521,7 @@ static void fec_reset_phy(struct platform_device *pdev)
gpio_set_value(phy_reset, 1);
}
#else /* CONFIG_OF */
-static inline int fec_get_phy_mode_dt(struct platform_device *pdev)
+static inline int fec_probe_dt(struct fec_enet_private *fep)
{
return -ENODEV;
}
@@ -1581,15 +1583,13 @@ fec_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ndev);
- ret = fec_get_phy_mode_dt(pdev);
+ ret = fec_probe_dt(fep);
if (ret < 0) {
pdata = pdev->dev.platform_data;
if (pdata)
fep->phy_interface = pdata->phy;
else
fep->phy_interface = PHY_INTERFACE_MODE_MII;
- } else {
- fep->phy_interface = ret;
}
for (i = 0; i < FEC_IRQ_NUM; i++) {
--
1.7.10.4
next prev parent reply other threads:[~2013-01-21 8:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 8:37 [PATCH] net: fec: Add support for multiple phys on mdiobus Sascha Hauer
2013-01-21 8:37 ` Sascha Hauer [this message]
2013-01-21 17:48 ` [PATCH 1/2] net: fec: refactor dt probing Baruch Siach
2013-01-21 18:27 ` Sascha Hauer
2013-01-21 8:37 ` [PATCH 2/2] net: fec: Add support for phys from devicetree Sascha Hauer
2013-01-21 8:56 ` [PATCH] net: fec: Add support for multiple phys on mdiobus Wolfgang Grandegger
2013-01-21 10:07 ` Sascha Hauer
2013-01-21 11:07 ` Wolfgang Grandegger
2013-01-21 11:12 ` Florian Fainelli
2013-01-21 11:33 ` Wolfgang Grandegger
2013-01-21 11:56 ` Sascha Hauer
2013-01-21 12:06 ` Sascha Hauer
2013-01-22 7:22 ` Wolfgang Grandegger
2013-01-22 14:47 ` Florian Fainelli
2013-01-22 15:03 ` Wolfgang Grandegger
2013-01-22 15:19 ` Florian Fainelli
2013-01-22 15:26 ` Wolfgang Grandegger
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=1358757475-21035-2-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=shawn.guo@linaro.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).