Re: [PATCH net-next 3/3] net: phy: mscc: implement RGMII skew delay configuration

From: Antoine Tenart
Date: Thu Feb 27 2020 - 13:55:32 EST


Hi Quentin,

On Thu, Feb 27, 2020 at 05:21:58PM +0100, Quentin Schulz wrote:
> On 2020-02-27 16:28, Antoine Tenart wrote:
> >
> > + if (of_find_property(dev->of_node, "vsc8584,rgmii-skew-rx", NULL) ||
> > + of_find_property(dev->of_node, "vsc8584,rgmii-skew-tx", NULL)) {
> > + of_property_read_u32(dev->of_node, "vsc8584,rgmii-skew-rx",
> > &skew_rx);
> > + of_property_read_u32(dev->of_node, "vsc8584,rgmii-skew-tx",
> > &skew_tx);
> > +
>
> Reading the code, I think **!**of_property_read_u32 could directly replace
> of_find_property in your condition and spare you two calls to that function.

Sure.

> Final nitpick: I would see a check of the skew_rx/tx from DT before you put
> them in the following line, they could be drastically different from 0-8
> value set that you expect considering you're reading a u32 (pass them
> through a GENMASK at least?)

That makes sense, I can add a check.

Thanks,
Antoine

--
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com