[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dc7c8414-55fe-4d86-8e5f-7cf7eeb73f97@gmail.com>
Date: Fri, 17 Oct 2025 22:56:34 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, David Miller <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Russell King - ARM Linux <linux@...linux.org.uk>,
"moderated list:ARM/STM32 ARCHITECTURE"
<linux-stm32@...md-mailman.stormreply.com>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH net-next] net: stmmac: mdio: use phy_find_first to
simplify stmmac_mdio_register
On 10/17/2025 10:39 PM, Andrew Lunn wrote:
>> - int addr, found, max_addr;
>> + struct phy_device *phydev;
>> + int addr, max_addr;
>>
>> if (!mdio_bus_data)
>> return 0;
>> @@ -668,41 +669,31 @@ int stmmac_mdio_register(struct net_device *ndev)
>> if (priv->plat->phy_node || mdio_node)
>> goto bus_register_done;
>>
>> - found = 0;
>> - for (addr = 0; addr < max_addr; addr++) {
>
> With this loop gone...
>
>> + phydev = phy_find_first(new_bus);
>> + if (!phydev || phydev->mdio.addr >= max_addr) {
>> dev_warn(dev, "No PHY found\n");
>> err = -ENODEV;
>> goto no_phy_found;
>> }
>>
>> + /*
>> + * If an IRQ was provided to be assigned after
>> + * the bus probe, do it here.
>> + */
>> + if (!mdio_bus_data->irqs && mdio_bus_data->probed_phy_irq > 0) {
>> + new_bus->irq[addr] = mdio_bus_data->probed_phy_irq;
>
> ... what is setting addr to a value?
>
Thanks. Indeed, addr can be removed and here phydev->mdio.addr has to be used.
> Andrew
--
pw-bot: cr
Powered by blists - more mailing lists