[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180820134234.GC6583@lunn.ch>
Date: Mon, 20 Aug 2018 15:42:34 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Ahmad Fatoum <a.fatoum@...gutronix.de>
Cc: "David S. Miller" <davem@...emloft.net>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
kernel@...gutronix.de, netdev@...r.kernel.org, mdf@...nel.org,
Brad Mouring <brad.mouring@...com>,
Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH 3/4] net: macb: Support specifying PHYs in a mdio
container dts node
On Mon, Aug 20, 2018 at 02:12:37PM +0200, Ahmad Fatoum wrote:
> To align macb DT entries with those of other MACs.
> For backwards compatibility, the old way remains supported.
>
> Suggested-by: Andrew Lunn <andrew@...n.ch>
> Signed-off-by: Ahmad Fatoum <a.fatoum@...gutronix.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;
This is correct. But i would prefer the more readable
struct device_node *node = of_get_child_by_name(np, "mdio");
if (!node)
/* Allow for the deprecated PHYs in the MAC node. */
node = 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);
> }
Also, the device tree binding documentation needs updating.
Thanks
Andrew
Powered by blists - more mailing lists