From: Andrew Lunn <andrew@lunn.ch>
To: Buday Csaba <buday.csaba@prolan.hu>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5 1/4] net: mdio: common handling of phy reset properties
Date: Wed, 29 Oct 2025 14:03:30 +0100 [thread overview]
Message-ID: <3a937e5c-0c0f-431f-a300-9d4c60f3a3ff@lunn.ch> (raw)
In-Reply-To: <a96ac9a58165a4ea15b1c96cab3bbc5d568e9cba.1761732347.git.buday.csaba@prolan.hu>
On Wed, Oct 29, 2025 at 11:23:41AM +0100, Buday Csaba wrote:
> Unify the handling of reset properties for an `mdio_device`.
> Replace mdiobus_register_gpiod() and mdiobus_register_reset() with
> mdio_device_register_reset() and mdio_device_unregister_reset(),
> and move them from mdio_bus.c to mdio_device.c, where they belong.
You should probably mention here that there are two sets of reset
properties. One set applies to the bus as a whole, and the second is
per device on the bus. You would expect the whole bus properties to be
handled in mdio_bus.c, where as the per device properties might make
more sense in mdio_device.c. So you can comment you are only moving
the per device reset code.
>
> The new functions handle both reset-controllers and reset-gpios,
> and also read the corresponding firmware properties from the
> device tree, which were previously handled in fwnode_mdio.c.
> This makes tracking the reset properties easier.
Please split this patch.
It is normal when moving a function to just move it, make no
additional changes. That makes the change smaller, easier to review,
since it is all about, does the new location make sense?
Once it is in the new location, you can then have patches which
refactor it.
> -static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
> -{
> - /* Deassert the optional reset signal */
> - mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev,
> - "reset", GPIOD_OUT_LOW);
> - if (IS_ERR(mdiodev->reset_gpio))
> - return PTR_ERR(mdiodev->reset_gpio);
> -
> - if (mdiodev->reset_gpio)
> - gpiod_set_consumer_name(mdiodev->reset_gpio, "PHY reset");
> -
> - return 0;
> -}
> -
> +/**
> + * mdio_device_register_reset - Read and initialize the reset properties of
> + * an mdio device
> + * @mdiodev: mdio_device structure
> + *
> + * Return: Zero if successful, negative error code on failure
> + */
> +int mdio_device_register_reset(struct mdio_device *mdiodev)
> +{
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(mdio_device_register_reset);
Before it did not require an EXPORT_SYMBOL, but now it does? That
makes me wounder if it is in the correct place. This should be a core
function, why would something outside of the core need it?
Also, please use the _GPL variant.
Andrew
next prev parent reply other threads:[~2025-10-29 13:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 10:23 [PATCH net-next v5 0/4] net: mdio: implement optional PHY reset before MDIO access Buday Csaba
2025-10-29 10:23 ` [PATCH net-next v5 1/4] net: mdio: common handling of phy reset properties Buday Csaba
2025-10-29 13:03 ` Andrew Lunn [this message]
2025-10-29 13:59 ` Buday Csaba
2025-10-29 10:23 ` [PATCH net-next v5 2/4] net: mdio: change property read from fwnode_property_read_u32() to device_property_read_u32() Buday Csaba
2025-10-29 13:09 ` Andrew Lunn
2025-10-29 10:23 ` [PATCH net-next v5 3/4] net: mdio: reset PHY before attempting to access registers in fwnode_mdiobus_register_phy Buday Csaba
2025-10-29 13:20 ` Andrew Lunn
2025-10-29 14:15 ` Buday Csaba
2025-10-29 15:15 ` Andrew Lunn
2025-10-30 6:33 ` Buday Csaba
2025-10-29 10:23 ` [PATCH net-next v5 4/4] net: mdio: add message when resetting a PHY before registration Buday Csaba
2025-10-29 13:21 ` Andrew Lunn
2025-10-29 12:43 ` [PATCH net-next v5 0/4] net: mdio: implement optional PHY reset before MDIO access Andrew Lunn
2025-10-29 13:42 ` Buday Csaba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3a937e5c-0c0f-431f-a300-9d4c60f3a3ff@lunn.ch \
--to=andrew@lunn.ch \
--cc=buday.csaba@prolan.hu \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®