mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Samin Guo <samin.guo@starfivetech.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, Peter Geis <pgwipeout@gmail.com>,
	Frank <Frank.Sae@motor-comm.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh+dt@kernel.org>, Conor Dooley <conor@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Yanhong Wang <yanhong.wang@starfivetech.com>
Subject: Re: [PATCH v4 2/2] net: phy: motorcomm: Add pad drive strength cfg support
Date: Fri, 14 Jul 2023 20:49:49 +0200	[thread overview]
Message-ID: <55cd8a47-89e5-4f62-8162-c744e1a99ad5@lunn.ch> (raw)
In-Reply-To: <20230714101406.17686-3-samin.guo@starfivetech.com>

> +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

  reply	other threads:[~2023-07-14 18:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14 10:14 [PATCH v4 0/2] Add motorcomm phy pad-driver-strength-cfg support Samin Guo
2023-07-14 10:14 ` [PATCH v4 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg Samin Guo
2023-07-14 18:54   ` Andrew Lunn
2023-07-17  8:28     ` Guo Samin
2023-07-15  2:47   ` Rob Herring
2023-07-17  8:35     ` Guo Samin
2023-07-14 10:14 ` [PATCH v4 2/2] net: phy: motorcomm: Add pad drive strength cfg support Samin Guo
2023-07-14 18:49   ` Andrew Lunn [this message]
2023-07-17  8:40     ` Guo Samin

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=55cd8a47-89e5-4f62-8162-c744e1a99ad5@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Frank.Sae@motor-comm.com \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pgwipeout@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=samin.guo@starfivetech.com \
    --cc=yanhong.wang@starfivetech.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®