Re: [PATCH v4 2/2] net: phy: motorcomm: Add pad drive strength cfg support
From: Andrew Lunn
Date:  Fri Jul 14 2023 - 14:50:02 EST
> +static u32 yt8531_get_ds_map(struct phy_device *phydev, u32 cur)
> +{
> +	u32 vol;
> +	int i;
> +
> +	vol = yt8531_get_ldo_vol(phydev);
> +	for (i = 0; i < ARRAY_SIZE(yt8531_ldo_vol); i++) {
> +		if (yt8531_ldo_vol[i].vol == vol && yt8531_ldo_vol[i].cur == cur)
> +			return yt8531_ldo_vol[i].ds;
> +	}
> +
> +	phydev_warn(phydev,
> +		    "No matching current value was found %d, Use default value.\n", cur);
> +
> +	return YT8531_RGMII_RX_DS_DEFAULT;
If there is a value in DT and it is invalid, return -EINVAL and fail
the probe. Only use the default if there is no value in DT.
    Andrew