net: ethernet: ti: cpts: disable cpts when unregistered
authorGrygorii Strashko <grygorii.strashko@ti.com>
Wed, 7 Dec 2016 00:00:38 +0000 (18:00 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Dec 2016 16:13:47 +0000 (11:13 -0500)
The cpts now is left enabled after unregistration.
Hence, disable it in cpts_unregister().

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpts.c

index 3dda6d5ba0aa004cd72db8fd093dead81877a8f7..d3c1ac5e93364a05e1f7f904bf3532859212fc37 100644 (file)
@@ -404,6 +404,10 @@ void cpts_unregister(struct cpts *cpts)
                ptp_clock_unregister(cpts->clock);
                cancel_delayed_work_sync(&cpts->overflow_work);
        }
+
+       cpts_write32(cpts, 0, int_enable);
+       cpts_write32(cpts, 0, control);
+
        if (cpts->refclk)
                cpts_clk_release(cpts);
 }