Re: [PATCH v1 2/2] net: phy: motorcomm: Add pad drive strength cfg support

From: Andrew Lunn
Date: Wed Apr 26 2023 - 10:34:05 EST


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