[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a2d59c0-be25-4b83-b732-138d04f62292@lunn.ch>
Date: Fri, 17 Oct 2025 22:39:04 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Heiner Kallweit <hkallweit1@...il.com>
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
> - 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?
Andrew
Powered by blists - more mailing lists