[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e61e1c1c-083b-472f-8edd-b16832ca578e@lunn.ch>
Date: Wed, 29 Oct 2025 14:20:14 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Buday Csaba <buday.csaba@...lan.hu>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Philipp Zabel <p.zabel@...gutronix.de>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v5 3/4] net: mdio: reset PHY before attempting
to access registers in fwnode_mdiobus_register_phy
> +/* Hard-reset a PHY before registration */
> +static int fwnode_reset_phy(struct mii_bus *bus, u32 addr,
> + struct fwnode_handle *phy_node)
> +{
> + struct mdio_device *tmpdev;
> + int rc;
> +
> + tmpdev = mdio_device_create(bus, addr);
> + if (IS_ERR(tmpdev))
> + return PTR_ERR(tmpdev);
> +
> + fwnode_handle_get(phy_node);
You add a _get() here. Where is the corresponding _put()?
Also, fwnode_handle_get() returns a handle. Why do you throw it away?
What is the point of this get?
> + device_set_node(&tmpdev->dev, phy_node);
> + rc = mdio_device_register_reset(tmpdev);
> + if (rc) {
> + mdio_device_free(tmpdev);
> + return rc;
> + }
> +
> + mdio_device_reset(tmpdev, 1);
> + mdio_device_reset(tmpdev, 0);
> +
> + mdio_device_unregister_reset(tmpdev);
> + mdio_device_free(tmpdev);
> +
> + return 0;
> +}
> +
Andrew
Powered by blists - more mailing lists