* [PATCH net-next] ravb: Add fixed-link support
@ 2015-12-13 15:16 Yoshihiro Kaneko
2015-12-13 21:00 ` Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Kaneko @ 2015-12-13 15:16 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Sergei Shtylyov, Simon Horman, Magnus Damm,
linux-sh
From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
This patch adds support of the fixed PHY.
This patch is based on commit 87009814cdbb ("ucc_geth: use the new fixed
PHY helpers").
Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---
This patch is based on the master branch of David Miller's next networking
tree.
drivers/net/ethernet/renesas/ravb_main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 1cf1226..300acb3 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -880,6 +880,7 @@ static int ravb_phy_init(struct net_device *ndev)
struct ravb_private *priv = netdev_priv(ndev);
struct phy_device *phydev;
struct device_node *pn;
+ int err;
priv->link = 0;
priv->speed = 0;
@@ -887,6 +888,17 @@ static int ravb_phy_init(struct net_device *ndev)
/* Try connecting to PHY */
pn = of_parse_phandle(np, "phy-handle", 0);
+ if (!pn) {
+ /* 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;
+ }
+ pn = np;
+ }
phydev = of_phy_connect(ndev, pn, ravb_adjust_link, 0,
priv->phy_interface);
if (!phydev) {
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ravb: Add fixed-link support
2015-12-13 15:16 [PATCH net-next] ravb: Add fixed-link support Yoshihiro Kaneko
@ 2015-12-13 21:00 ` Sergei Shtylyov
2015-12-15 10:47 ` Yoshihiro Kaneko
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2015-12-13 21:00 UTC (permalink / raw)
To: Yoshihiro Kaneko, netdev
Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh
Hello.
On 12/13/2015 06:16 PM, Yoshihiro Kaneko wrote:
> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>
> This patch adds support of the fixed PHY.
> This patch is based on commit 87009814cdbb ("ucc_geth: use the new fixed
> PHY helpers").
>
> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> This patch is based on the master branch of David Miller's next networking
> tree.
>
> drivers/net/ethernet/renesas/ravb_main.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 1cf1226..300acb3 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
[...]
> @@ -887,6 +888,17 @@ static int ravb_phy_init(struct net_device *ndev)
>
> /* Try connecting to PHY */
> pn = of_parse_phandle(np, "phy-handle", 0);
> + if (!pn) {
> + /* 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;
> + }
> + pn = np;
I'm seeing that other drivers call of_node_get() here, why don't you?
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ravb: Add fixed-link support
2015-12-13 21:00 ` Sergei Shtylyov
@ 2015-12-15 10:47 ` Yoshihiro Kaneko
0 siblings, 0 replies; 3+ messages in thread
From: Yoshihiro Kaneko @ 2015-12-15 10:47 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: netdev, David S. Miller, Simon Horman, Magnus Damm, Linux-sh list
Hi,
2015-12-14 6:00 GMT+09:00 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> Hello.
>
> On 12/13/2015 06:16 PM, Yoshihiro Kaneko wrote:
>
>> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>>
>> This patch adds support of the fixed PHY.
>> This patch is based on commit 87009814cdbb ("ucc_geth: use the new fixed
>> PHY helpers").
>>
>> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>> ---
>>
>> This patch is based on the master branch of David Miller's next networking
>> tree.
>>
>> drivers/net/ethernet/renesas/ravb_main.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
>> b/drivers/net/ethernet/renesas/ravb_main.c
>> index 1cf1226..300acb3 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>
> [...]
>>
>> @@ -887,6 +888,17 @@ static int ravb_phy_init(struct net_device *ndev)
>>
>> /* Try connecting to PHY */
>> pn = of_parse_phandle(np, "phy-handle", 0);
>> + if (!pn) {
>> + /* 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;
>> + }
>> + pn = np;
>
>
> I'm seeing that other drivers call of_node_get() here, why don't you?
Thanks.
I sent v2.
>
> [...]
>
> MBR, Sergei
>
Thanks,
kaneko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-15 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-13 15:16 [PATCH net-next] ravb: Add fixed-link support Yoshihiro Kaneko
2015-12-13 21:00 ` Sergei Shtylyov
2015-12-15 10:47 ` Yoshihiro Kaneko
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).