From: Guo Samin <samin.guo@starfivetech.com>
To: Andrew Lunn <andrew@lunn.ch>, Frank Sae <Frank.Sae@motor-comm.com>
Cc: <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
<netdev@vger.kernel.org>, Peter Geis <pgwipeout@gmail.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>,
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 v1 2/2] net: phy: motorcomm: Add pad drive strength cfg support
Date: Thu, 27 Apr 2023 14:46:26 +0800 [thread overview]
Message-ID: <988e7ff1-ef0e-6224-98fb-e3d564806477@starfivetech.com> (raw)
In-Reply-To: <4c935728-ab18-4941-9621-c26e3b3799f7@lunn.ch>
Re: [PATCH v1 2/2] net: phy: motorcomm: Add pad drive strength cfg support
From: Andrew Lunn <andrew@lunn.ch>
to: Frank Sae <Frank.Sae@motor-comm.com>
data: 2023/4/26
>>> + u32 val;
>>>
>>> ret = ytphy_rgmii_clk_delay_config_with_lock(phydev);
>>> if (ret < 0)
>>> @@ -1518,6 +1524,32 @@ static int yt8531_config_init(struct phy_device *phydev)
>>> return ret;
>>> }
>>>
>>> + if (!of_property_read_u32(node, "rx-clk-driver-strength", &val)) {
>>
>> Please check the val of "val", add the handle of default value.
>
> You can assign val to 3, or better still some #define, before calling
> of_property_read_u32(). If the property is not found, val will retain
> that value, and you can then write it to the register.
>
> But please do add range checks for when val is in DT. We don't want
> anybody using 42. -EINVAL should be returned.
>
> Andrew
Thanks, good advice.
Best regards,
Samin
next prev parent reply other threads:[~2023-04-27 6:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 6:35 [PATCH v1 0/2] Add motorcomm phy pad-driver-strength-cfg support Samin Guo
2023-04-26 6:35 ` [PATCH v1 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg Samin Guo
2023-04-26 9:59 ` Frank Sae
2023-04-27 0:50 ` Guo Samin
2023-04-26 14:29 ` Andrew Lunn
2023-04-27 6:43 ` Guo Samin
2023-04-26 6:35 ` [PATCH v1 2/2] net: phy: motorcomm: Add pad drive strength cfg support Samin Guo
2023-04-26 10:24 ` Frank Sae
2023-04-26 14:33 ` Andrew Lunn
2023-04-27 6:46 ` Guo Samin [this message]
2023-04-27 0:55 ` 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=988e7ff1-ef0e-6224-98fb-e3d564806477@starfivetech.com \
--to=samin.guo@starfivetech.com \
--cc=Frank.Sae@motor-comm.com \
--cc=andrew@lunn.ch \
--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=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
Powered by JetHome