netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: kernel@pengutronix.de, netdev@vger.kernel.org, mdf@kernel.org,
	Brad Mouring <brad.mouring@ni.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 3/4] net: macb: Support specifying PHYs in a mdio container dts node
Date: Mon, 20 Aug 2018 14:12:37 +0200	[thread overview]
Message-ID: <20180820121238.7779-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20180820121238.7779-1-a.fatoum@pengutronix.de>

To align macb DT entries with those of other MACs.
For backwards compatibility, the old way remains supported.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/net/ethernet/cadence/macb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index ef6ce8691443..2ebc5698db9d 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -596,10 +596,10 @@ static int macb_mii_init(struct macb *bp)
 
 		err = mdiobus_register(bp->mii_bus);
 	} else {
+		struct device_node *node = of_get_child_by_name(np, "mdio") ?: np;
 		if (pdata)
 			bp->mii_bus->phy_mask = pdata->phy_mask;
-
-		err = of_mdiobus_register(bp->mii_bus, np);
+		err = of_mdiobus_register(bp->mii_bus, node);
 	}
 
 	if (err)
-- 
2.18.0

  parent reply	other threads:[~2018-08-20 15:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 12:12 [PATCH 1/4] net: macb: Fix regression breaking non-MDIO fixed-link PHYs Ahmad Fatoum
2018-08-20 12:12 ` [PATCH 2/4] of: phy: Warn about unexpected fixed-links in of_mdiobus_register Ahmad Fatoum
2018-08-20 12:31   ` Ahmad Fatoum
2018-08-20 13:37   ` Andrew Lunn
2018-08-20 13:51     ` Ahmad Fatoum
2018-08-20 12:12 ` Ahmad Fatoum [this message]
2018-08-20 13:42   ` [PATCH 3/4] net: macb: Support specifying PHYs in a mdio container dts node Andrew Lunn
2018-08-20 13:45     ` Ahmad Fatoum
2018-08-20 13:56       ` Andrew Lunn
2018-08-20 12:12 ` [PATCH 4/4] ARM: dts: macb: wrap macb PHYs in a mdio container Ahmad Fatoum
2018-08-20 13:55 ` [PATCH 1/4] net: macb: Fix regression breaking non-MDIO fixed-link PHYs Andrew Lunn
2018-08-20 15:56   ` Ahmad Fatoum
2018-08-20 19:06     ` Andrew Lunn
2018-08-21  8:26       ` Ahmad Fatoum
2018-08-21 13:34         ` Andrew Lunn
2018-08-21 14:59           ` Ahmad Fatoum

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=20180820121238.7779-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=brad.mouring@ni.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=mdf@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.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).