[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190524202100.GR21208@lunn.ch>
Date: Fri, 24 May 2019 22:21:00 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: netdev@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
Krzysztof Halasa <khalasa@...p.pl>
Subject: Re: [PATCH 8/8] net: ethernet: ixp4xx: Support device tree probing
> + /* FIXME: get from MDIO handle */
> + ret = of_property_read_u32(np, "phy", &val);
> + if (ret) {
> + dev_err(dev, "no phy\n");
> + return NULL;
> + }
> + plat->phy = val;
Hi Linus
You might want to work on the MDIO code first. It is O.K. to do
something like:
np = NULL;
if (dev->of_node)
np = of_get_child_by_name(dev->of_node, "mdio");
of_mdiobus_register(np, mdio_bus)
If np is NULL, it will fall back to mdiobus_register().
Then here you can do the correct
priv->phy_node = of_parse_phandle(dev->of_node, "phy-handle", 0);
and later call
phy = of_phy_connect(ndev, priv->phy_node, &ixp4xx_adjust_link,
PHY_INTERFACE_MODE_MII);
You just need to watch out for the -EPROBE_DEFFERED.
Andrew
Powered by blists - more mailing lists