[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YH4v9AWjVMtGqLAw@lunn.ch>
Date: Tue, 20 Apr 2021 03:35:48 +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>,
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
> + 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.
Andrew
Powered by blists - more mailing lists