phy: mscc: Fix when PTP clock is register and unregister
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Mon, 25 Aug 2025 06:55:43 +0000 (08:55 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Aug 2025 00:10:51 +0000 (17:10 -0700)
commit882e57cbc7204662f6c5672d5b04336c1d790b03
treeec2aa2cd87d17ed7d6cf56d816d337c40c36a702
parente81a7f65288c7e2cfb7e7890f648e099fd885ab3
phy: mscc: Fix when PTP clock is register and unregister

It looks like that every time when the interface was set down and up the
driver was creating a new ptp clock. On top of this the function
ptp_clock_unregister was never called.
Therefore fix this by calling ptp_clock_register and initialize the
mii_ts struct inside the probe function and call ptp_clock_unregister when
driver is removed.

Fixes: 7d272e63e0979d ("net: phy: mscc: timestamping and PHC support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250825065543.2916334-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/mscc/mscc.h
drivers/net/phy/mscc/mscc_main.c
drivers/net/phy/mscc/mscc_ptp.c