Skip to content

Commit a450672

Browse files
Radu Pirea (OSS)Paolo Abeni
authored andcommitted
net: phy: nxp-c45-tja11xx: add remove callback
Unregister PTP clock when the driver is removed. Purge the RX and TX skb queues. Fixes: 514def5 ("phy: nxp-c45-tja11xx: add timestamping support") CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Radu Pirea (OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230406095904.75456-1-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 9a06fe0 commit a450672

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/net/phy/nxp-c45-tja11xx.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,17 @@ static int nxp_c45_probe(struct phy_device *phydev)
13371337
return ret;
13381338
}
13391339

1340+
static void nxp_c45_remove(struct phy_device *phydev)
1341+
{
1342+
struct nxp_c45_phy *priv = phydev->priv;
1343+
1344+
if (priv->ptp_clock)
1345+
ptp_clock_unregister(priv->ptp_clock);
1346+
1347+
skb_queue_purge(&priv->tx_queue);
1348+
skb_queue_purge(&priv->rx_queue);
1349+
}
1350+
13401351
static struct phy_driver nxp_c45_driver[] = {
13411352
{
13421353
PHY_ID_MATCH_MODEL(PHY_ID_TJA_1103),
@@ -1359,6 +1370,7 @@ static struct phy_driver nxp_c45_driver[] = {
13591370
.set_loopback = genphy_c45_loopback,
13601371
.get_sqi = nxp_c45_get_sqi,
13611372
.get_sqi_max = nxp_c45_get_sqi_max,
1373+
.remove = nxp_c45_remove,
13621374
},
13631375
};
13641376

0 commit comments

Comments
 (0)