Re: [PATCH net-next v3 2/3] net: phy: Add helper for getting tx amplitude gain

From: Russell King (Oracle)
Date: Tue Feb 04 2025 - 12:55:26 EST


On Tue, Feb 04, 2025 at 02:09:16PM +0100, Dimitri Fedrau via B4 Relay wrote:
> #if IS_ENABLED(CONFIG_OF_MDIO)
> -static int phy_get_int_delay_property(struct device *dev, const char *name)
> +static int phy_get_u32_property(struct device *dev, const char *name)
> {
> s32 int_delay;
> int ret;
> @@ -3108,7 +3108,7 @@ static int phy_get_int_delay_property(struct device *dev, const char *name)
> return int_delay;

Hmm. You're changing the name of this function from "int" to "u32", yet
it still returns "int".

What range of values are you expecting to be returned by this function?
If it's the full range of u32 values, then that overlaps with the error
range returned by device_property_read_u32().

I'm wondering whether it would be better to follow the example set by
these device_* functions, and pass a pointer for the value to them, and
just have the return value indicating success/failure.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!