File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
drivers/net/ethernet/mscc Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1979,14 +1979,18 @@ static struct ptp_clock_info ocelot_ptp_clock_info = {
1979
1979
1980
1980
static int ocelot_init_timestamp (struct ocelot * ocelot )
1981
1981
{
1982
+ struct ptp_clock * ptp_clock ;
1983
+
1982
1984
ocelot -> ptp_info = ocelot_ptp_clock_info ;
1983
- ocelot -> ptp_clock = ptp_clock_register (& ocelot -> ptp_info , ocelot -> dev );
1984
- if (IS_ERR (ocelot -> ptp_clock ))
1985
- return PTR_ERR (ocelot -> ptp_clock );
1985
+ ptp_clock = ptp_clock_register (& ocelot -> ptp_info , ocelot -> dev );
1986
+ if (IS_ERR (ptp_clock ))
1987
+ return PTR_ERR (ptp_clock );
1986
1988
/* Check if PHC support is missing at the configuration level */
1987
- if (!ocelot -> ptp_clock )
1989
+ if (!ptp_clock )
1988
1990
return 0 ;
1989
1991
1992
+ ocelot -> ptp_clock = ptp_clock ;
1993
+
1990
1994
ocelot_write (ocelot , SYS_PTP_CFG_PTP_STAMP_WID (30 ), SYS_PTP_CFG );
1991
1995
ocelot_write (ocelot , 0xffffffff , ANA_TABLES_PTP_ID_LOW );
1992
1996
ocelot_write (ocelot , 0xffffffff , ANA_TABLES_PTP_ID_HIGH );
@@ -2213,6 +2217,8 @@ void ocelot_deinit(struct ocelot *ocelot)
2213
2217
destroy_workqueue (ocelot -> stats_queue );
2214
2218
mutex_destroy (& ocelot -> stats_lock );
2215
2219
ocelot_ace_deinit ();
2220
+ if (ocelot -> ptp_clock )
2221
+ ptp_clock_unregister (ocelot -> ptp_clock );
2216
2222
2217
2223
for (i = 0 ; i < ocelot -> num_phys_ports ; i ++ ) {
2218
2224
port = ocelot -> ports [i ];
You can’t perform that action at this time.
0 commit comments