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 @@ -2149,14 +2149,18 @@ static struct ptp_clock_info ocelot_ptp_clock_info = {
2149
2149
2150
2150
static int ocelot_init_timestamp (struct ocelot * ocelot )
2151
2151
{
2152
+ struct ptp_clock * ptp_clock ;
2153
+
2152
2154
ocelot -> ptp_info = ocelot_ptp_clock_info ;
2153
- ocelot -> ptp_clock = ptp_clock_register (& ocelot -> ptp_info , ocelot -> dev );
2154
- if (IS_ERR (ocelot -> ptp_clock ))
2155
- return PTR_ERR (ocelot -> ptp_clock );
2155
+ ptp_clock = ptp_clock_register (& ocelot -> ptp_info , ocelot -> dev );
2156
+ if (IS_ERR (ptp_clock ))
2157
+ return PTR_ERR (ptp_clock );
2156
2158
/* Check if PHC support is missing at the configuration level */
2157
- if (!ocelot -> ptp_clock )
2159
+ if (!ptp_clock )
2158
2160
return 0 ;
2159
2161
2162
+ ocelot -> ptp_clock = ptp_clock ;
2163
+
2160
2164
ocelot_write (ocelot , SYS_PTP_CFG_PTP_STAMP_WID (30 ), SYS_PTP_CFG );
2161
2165
ocelot_write (ocelot , 0xffffffff , ANA_TABLES_PTP_ID_LOW );
2162
2166
ocelot_write (ocelot , 0xffffffff , ANA_TABLES_PTP_ID_HIGH );
@@ -2489,6 +2493,8 @@ void ocelot_deinit(struct ocelot *ocelot)
2489
2493
destroy_workqueue (ocelot -> stats_queue );
2490
2494
mutex_destroy (& ocelot -> stats_lock );
2491
2495
ocelot_ace_deinit ();
2496
+ if (ocelot -> ptp_clock )
2497
+ ptp_clock_unregister (ocelot -> ptp_clock );
2492
2498
2493
2499
for (i = 0 ; i < ocelot -> num_phys_ports ; i ++ ) {
2494
2500
port = ocelot -> ports [i ];
You can’t perform that action at this time.
0 commit comments