Thread (24 messages) 24 messages, 3 authors, 2021-03-08

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

From: Andy Shevchenko <hidden>
Date: 2021-02-18 17:39:27
Also in: linux-acpi, linux-arm-kernel, linux-devicetree, lkml

On Thu, Feb 18, 2021 at 7:28 AM Calvin Johnson
[off-list ref] 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 <redacted>
Reported-by: Dan Carpenter <redacted>
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 <redacted>
...
+               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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help