aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c7
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac.h2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c6
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c13
4 files changed, 12 insertions, 16 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index 4ec7397e7fb3..a1b17cd7886b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -347,10 +347,9 @@ static void dwmac4_display_ring(void *head, unsigned int size, bool rx)
347 pr_info("%s descriptor ring:\n", rx ? "RX" : "TX"); 347 pr_info("%s descriptor ring:\n", rx ? "RX" : "TX");
348 348
349 for (i = 0; i < size; i++) { 349 for (i = 0; i < size; i++) {
350 if (p->des0) 350 pr_info("%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
351 pr_info("%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", 351 i, (unsigned int)virt_to_phys(p),
352 i, (unsigned int)virt_to_phys(p), 352 p->des0, p->des1, p->des2, p->des3);
353 p->des0, p->des1, p->des2, p->des3);
354 p++; 353 p++;
355 } 354 }
356} 355}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 8dc9056c1001..b15fc55f1b96 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -145,7 +145,7 @@ int stmmac_mdio_register(struct net_device *ndev);
145int stmmac_mdio_reset(struct mii_bus *mii); 145int stmmac_mdio_reset(struct mii_bus *mii);
146void stmmac_set_ethtool_ops(struct net_device *netdev); 146void stmmac_set_ethtool_ops(struct net_device *netdev);
147 147
148int stmmac_ptp_register(struct stmmac_priv *priv); 148void stmmac_ptp_register(struct stmmac_priv *priv);
149void stmmac_ptp_unregister(struct stmmac_priv *priv); 149void stmmac_ptp_unregister(struct stmmac_priv *priv);
150int stmmac_resume(struct device *dev); 150int stmmac_resume(struct device *dev);
151int stmmac_suspend(struct device *dev); 151int stmmac_suspend(struct device *dev);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 6c85b61aaa0b..48e71fad4210 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -676,7 +676,9 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
676 priv->hwts_tx_en = 0; 676 priv->hwts_tx_en = 0;
677 priv->hwts_rx_en = 0; 677 priv->hwts_rx_en = 0;
678 678
679 return stmmac_ptp_register(priv); 679 stmmac_ptp_register(priv);
680
681 return 0;
680} 682}
681 683
682static void stmmac_release_ptp(struct stmmac_priv *priv) 684static void stmmac_release_ptp(struct stmmac_priv *priv)
@@ -1710,7 +1712,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
1710 if (init_ptp) { 1712 if (init_ptp) {
1711 ret = stmmac_init_ptp(priv); 1713 ret = stmmac_init_ptp(priv);
1712 if (ret) 1714 if (ret)
1713 netdev_warn(priv->dev, "PTP support cannot init.\n"); 1715 netdev_warn(priv->dev, "fail to init PTP.\n");
1714 } 1716 }
1715 1717
1716#ifdef CONFIG_DEBUG_FS 1718#ifdef CONFIG_DEBUG_FS
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 289d52725a6c..1477471f8d44 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -177,7 +177,7 @@ static struct ptp_clock_info stmmac_ptp_clock_ops = {
177 * Description: this function will register the ptp clock driver 177 * Description: this function will register the ptp clock driver
178 * to kernel. It also does some house keeping work. 178 * to kernel. It also does some house keeping work.
179 */ 179 */
180int stmmac_ptp_register(struct stmmac_priv *priv) 180void stmmac_ptp_register(struct stmmac_priv *priv)
181{ 181{
182 spin_lock_init(&priv->ptp_lock); 182 spin_lock_init(&priv->ptp_lock);
183 priv->ptp_clock_ops = stmmac_ptp_clock_ops; 183 priv->ptp_clock_ops = stmmac_ptp_clock_ops;
@@ -185,15 +185,10 @@ int stmmac_ptp_register(struct stmmac_priv *priv)
185 priv->ptp_clock = ptp_clock_register(&priv->ptp_clock_ops, 185 priv->ptp_clock = ptp_clock_register(&priv->ptp_clock_ops,
186 priv->device); 186 priv->device);
187 if (IS_ERR(priv->ptp_clock)) { 187 if (IS_ERR(priv->ptp_clock)) {
188 netdev_err(priv->dev, "ptp_clock_register failed\n");
188 priv->ptp_clock = NULL; 189 priv->ptp_clock = NULL;
189 return PTR_ERR(priv->ptp_clock); 190 } else if (priv->ptp_clock)
190 } 191 netdev_info(priv->dev, "registered PTP clock\n");
191
192 spin_lock_init(&priv->ptp_lock);
193
194 netdev_dbg(priv->dev, "Added PTP HW clock successfully\n");
195
196 return 0;
197} 192}
198 193
199/** 194/**