lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4afb7ea-28f6-4a0a-8c17-277c6a043bea@huawei.com>
Date: Wed, 17 Dec 2025 21:18:06 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: Jonathan Cameron <jonathan.cameron@...wei.com>
CC: <shaojijie@...wei.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <andrew+netdev@...n.ch>,
	<horms@...nel.org>, <Frank.Sae@...or-comm.com>, <hkallweit1@...il.com>,
	<linux@...linux.org.uk>, <shenjian15@...wei.com>, <liuyonglong@...wei.com>,
	<chenhao418@...wei.com>, <salil.mehta@...wei.com>, <shiyongbang@...wei.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC net-next 1/6] net: phy: change of_phy_leds() to
 fwnode_phy_leds()


on 2025/12/17 18:37, Jonathan Cameron wrote:
> On Mon, 15 Dec 2025 20:57:00 +0800
> Jijie Shao <shaojijie@...wei.com> wrote:
>
>> Change of_phy_leds() to fwnode_phy_leds(), to support
>> of node, acpi node, and software node together.
>>
>> Signed-off-by: Jijie Shao <shaojijie@...wei.com>
> One minor suggestion inline. It is a 'while you are here'
> and whilst there are uses of the _scoped loops
> in drivers/net I'm not sure how much appetite there is
> for using them wider.
>
> Jonathan
>
>
>> ---
>>   drivers/net/phy/phy_device.c | 37 +++++++++++++++++-------------------
>>   1 file changed, 17 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
>> index 8
>> -
>> -	if (!node)
>> +	if (!fwnode)
>>   		return 0;
>>   
>> -	leds = of_get_child_by_name(node, "leds");
>> +	leds = fwnode_get_named_child_node(fwnode, "leds");
>>   	if (!leds)
>>   		return 0;
>>   
>> @@ -3311,17 +3308,17 @@ static int of_phy_leds(struct phy_device *phydev)
>>   		goto exit;
>>   	}
>>   
>> -	for_each_available_child_of_node_scoped(leds, led) {
>> -		err = of_phy_led(phydev, led);
>> +	fwnode_for_each_available_child_node(leds, led) {
> Maybe use the _scoped version to simplify this a little given
> you are changing it.


Yes, it is indeed necessary to use fwnode_for_each_available_child_node_scoped()

Thanks,
Jijie Shao



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ