stmmac: set ptp_clock to NULL while unregister
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Mon, 25 Aug 2014 12:56:19 +0000 (14:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Aug 2014 22:33:10 +0000 (15:33 -0700)
This is to properly put to NULL the ptp_clock while un-register the PTP support.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c

index b7ad3565566cc8a09b7964fcb59aca3921e8e57c..c5ee79d8a8c56478f9987efc2c0631c140aafc0d 100644 (file)
@@ -206,6 +206,7 @@ void stmmac_ptp_unregister(struct stmmac_priv *priv)
 {
        if (priv->ptp_clock) {
                ptp_clock_unregister(priv->ptp_clock);
+               priv->ptp_clock = NULL;
                pr_debug("Removed PTP HW clock successfully on %s\n",
                         priv->dev->name);
        }