[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <119144e3-d42e-e4dd-d95d-624e4816cbe3@gmail.com>
Date: Mon, 20 Feb 2017 14:31:26 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: YUAN Linyu <Linyu.Yuan@...atel-sbell.com.cn>,
"David S . Miller" <davem@...emloft.net>,
Andrew Lunn <andrew@...n.ch>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"cugyly@....com" <cugyly@....com>
Subject: Re: create drivers/net/mdio and move mdio drivers into it
On 02/19/2017 10:29 PM, YUAN Linyu wrote:
>
>
>> -----Original Message-----
>> From: Florian Fainelli [mailto:f.fainelli@...il.com]
>> Sent: Monday, February 20, 2017 1:42 PM
>> To: YUAN Linyu; David S . Miller; Andrew Lunn
>> Cc: netdev@...r.kernel.org; cugyly@....com
>> Subject: Re: create drivers/net/mdio and move mdio drivers into it
>>> 4. support mdio auto probe phy device.
>>
>> That's already the case, even in a Device Tree enabled system if you
>> omit to provide a "reg" property for child nodes, the bus is
>> automatically scanned.
>>
> I check of_mdiobus_registe() which not do auto scan.
> Which function should I refer?
of_mdiobus_register() does this:
/* Loop over the child nodes and register a phy_device for each
phy */
for_each_available_child_of_node(np, child) {
addr = of_mdio_parse_addr(&mdio->dev, child);
if (addr < 0) {
scanphys = true;
continue;
}
if (of_mdiobus_child_is_phy(child))
of_mdiobus_register_phy(mdio, child, addr);
else
of_mdiobus_register_device(mdio, child, addr);
}
if (!scanphys)
return 0;
It does continue with scanning the PHY child nodes which don't have a
correct "reg" property set here.
--
Florian
Powered by blists - more mailing lists