[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55cd8a47-89e5-4f62-8162-c744e1a99ad5@lunn.ch>
Date: Fri, 14 Jul 2023 20:49:49 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Samin Guo <samin.guo@...rfivetech.com>
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
netdev@...r.kernel.org, Peter Geis <pgwipeout@...il.com>,
Frank <Frank.Sae@...or-comm.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Conor Dooley <conor@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Yanhong Wang <yanhong.wang@...rfivetech.com>
Subject: Re: [PATCH v4 2/2] net: phy: motorcomm: Add pad drive strength cfg
support
> +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
Powered by blists - more mailing lists