[net-next PATCH v6 07/15] net: mdiobus: Introduce fwnode_mdiobus_register_phy()

Andy Shevchenko andy.shevchenko at gmail.com
Thu Feb 18 09:52:04 EST 2021


On Thu, Feb 18, 2021 at 7:28 AM Calvin Johnson
<calvin.johnson at oss.nxp.com> wrote:
>
> Introduce fwnode_mdiobus_register_phy() to register PHYs on the
> mdiobus. From the compatible string, identify whether the PHY is
> c45 and based on this create a PHY device instance which is
> registered on the mdiobus.

Thanks for an update!
Below some nit-picks, may be ignored.

> uninitialized symbol 'mii_ts'
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>

I don't think the above deserves to be in the commit message (rather
after the cutter '---' line as a changelog).

> Signed-off-by: Calvin Johnson <calvin.johnson at oss.nxp.com>

...

> +               if (mii_ts)
> +                       unregister_mii_timestamper(mii_ts);

...

> +                       if (mii_ts)
> +                               unregister_mii_timestamper(mii_ts);

I'm wondering if we can move this check to the
unregister_mii_timestamper() to make it NULL aware as many other
similar (unregister) APIs do. I have checked that there are currently
three users of this that can benefit of the change.

...

> +       /* phy->mii_ts may already be defined by the PHY driver. A
> +        * mii_timestamper probed via the device tree will still have
> +        * precedence.
> +        */
> +       if (mii_ts)
> +               phy->mii_ts = mii_ts;

I'm wondering if the belo form is better to read

        phy->mii_ts = mii_ts ?: phy->mii_ts;

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-arm-kernel mailing list