Re: [PATCH net] phy: mscc: Fix when PTP clock is register and unregister

From: Horatiu Vultur
Date: Fri Aug 22 2025 - 02:33:56 EST


The 08/21/2025 14:50, Vadim Fedorenko wrote:

Hi Vadim,

>
> On 21/08/2025 11:46, Horatiu Vultur wrote:
> > +static void __vsc8584_deinit_ptp(struct phy_device *phydev)
> > +{
> > + struct vsc8531_private *vsc8531 = phydev->priv;
> >
> > - vsc8531->ptp->ptp_clock = ptp_clock_register(&vsc8531->ptp->caps,
> > - &phydev->mdio.dev);
> > - return PTR_ERR_OR_ZERO(vsc8531->ptp->ptp_clock);
> > + ptp_clock_unregister(vsc8531->ptp->ptp_clock);
> > + skb_queue_purge(&vsc8531->rx_skbs_list);
> > }
> >
> > void vsc8584_config_ts_intr(struct phy_device *phydev)
> > @@ -1552,6 +1549,18 @@ int vsc8584_ptp_init(struct phy_device *phydev)
> > return 0;
> > }
> >
> > +void vsc8584_ptp_deinit(struct phy_device *phydev)
> > +{
> > + switch (phydev->phy_id & phydev->drv->phy_id_mask) {
> > + case PHY_ID_VSC8572:
> > + case PHY_ID_VSC8574:
> > + case PHY_ID_VSC8575:
> > + case PHY_ID_VSC8582:
> > + case PHY_ID_VSC8584:
> > + return __vsc8584_deinit_ptp(phydev);
>
> void function has no return value. as well as it shouldn't return
> anything. I'm not quite sure why do you need __vsc8584_deinit_ptp()
> at all, I think everything can be coded inside vsc8584_ptp_deinit()

I understand, I can update not to return anything.
Regarding __vsc8584_deinit_ptp, I have created that function just to be
similar with the __vsc8584_init_ptp.

>
> > + }
> > +}

--
/Horatiu