[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYdoPY0+Mt4QVNhMu44V1Y+6EsG1sMdXbf=h7e3FKKDMw@mail.gmail.com>
Date: Tue, 20 Apr 2021 10:38:59 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev <netdev@...r.kernel.org>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Zoltan HERPAI <wigyori@...0.hu>,
Raylynn Knight <rayknight@...com>
Subject: Re: [PATCH 2/3] net: ethernet: ixp4xx: Support device tree probing
On Tue, Apr 20, 2021 at 3:35 AM Andrew Lunn <andrew@...n.ch> wrote:
> > + phy_np = of_parse_phandle(np, "phy-handle", 0);
> > + if (phy_np) {
> > + ret = of_property_read_u32(phy_np, "reg", &val);
> > + if (ret) {
> > + dev_err(dev, "cannot find phy reg\n");
> > + return NULL;
> > + }
> > + of_node_put(phy_np);
> > + } else {
> > + dev_err(dev, "cannot find phy instance\n");
> > + val = 0;
> > + }
> > + plat->phy = val;
>
> phy-handle can point to a PHY on any bus. You should not assume it is
> the devices own bus. Once you have phy_np call of_phy_find_device()
> which gives you the actual phy device. Please don't let the
> limitations of the current platform data limit you from implementing
> this correctly.
In patch 3/3 I migrate to of_phy_get_and_connect() which I assume
fixes this, I just wanted to split up the work, but do you prefer
that I simply squash patches 2 & 3 into one?
Yours,
Linus Walleij
Powered by blists - more mailing lists