[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c935728-ab18-4941-9621-c26e3b3799f7@lunn.ch>
Date: Wed, 26 Apr 2023 16:33:54 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Frank Sae <Frank.Sae@...or-comm.com>
Cc: Samin Guo <samin.guo@...rfivetech.com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
netdev@...r.kernel.org, Peter Geis <pgwipeout@...il.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>,
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 v1 2/2] net: phy: motorcomm: Add pad drive strength cfg
support
> > + 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
Powered by blists - more mailing lists