ravb: skip gPTP start/stop on R-Car gen3

When adding support for the  R-Car gen3 gPTP active in configuration mode,
some call sites of ravb_ptp_{init|stop}() were missed due to an oversight.
Add  checks for the R-Car gen2 SoCs around these...

Fixes: f5d7837f96 ("ravb: ptp: Add CONFIG mode support")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sergei Shtylyov 2016-02-06 17:47:22 +03:00 committed by David S. Miller
parent d0c5f45ae3
commit 50bfd83830
1 changed files with 8 additions and 4 deletions

View File

@ -1139,7 +1139,8 @@ static int ravb_set_ringparam(struct net_device *ndev,
if (netif_running(ndev)) { if (netif_running(ndev)) {
netif_device_detach(ndev); netif_device_detach(ndev);
/* Stop PTP Clock driver */ /* Stop PTP Clock driver */
ravb_ptp_stop(ndev); if (priv->chip_id == RCAR_GEN2)
ravb_ptp_stop(ndev);
/* Wait for DMA stopping */ /* Wait for DMA stopping */
error = ravb_stop_dma(ndev); error = ravb_stop_dma(ndev);
if (error) { if (error) {
@ -1170,7 +1171,8 @@ static int ravb_set_ringparam(struct net_device *ndev,
ravb_emac_init(ndev); ravb_emac_init(ndev);
/* Initialise PTP Clock driver */ /* Initialise PTP Clock driver */
ravb_ptp_init(ndev, priv->pdev); if (priv->chip_id == RCAR_GEN2)
ravb_ptp_init(ndev, priv->pdev);
netif_device_attach(ndev); netif_device_attach(ndev);
} }
@ -1298,7 +1300,8 @@ static void ravb_tx_timeout_work(struct work_struct *work)
netif_tx_stop_all_queues(ndev); netif_tx_stop_all_queues(ndev);
/* Stop PTP Clock driver */ /* Stop PTP Clock driver */
ravb_ptp_stop(ndev); if (priv->chip_id == RCAR_GEN2)
ravb_ptp_stop(ndev);
/* Wait for DMA stopping */ /* Wait for DMA stopping */
ravb_stop_dma(ndev); ravb_stop_dma(ndev);
@ -1311,7 +1314,8 @@ static void ravb_tx_timeout_work(struct work_struct *work)
ravb_emac_init(ndev); ravb_emac_init(ndev);
/* Initialise PTP Clock driver */ /* Initialise PTP Clock driver */
ravb_ptp_init(ndev, priv->pdev); if (priv->chip_id == RCAR_GEN2)
ravb_ptp_init(ndev, priv->pdev);
netif_tx_start_all_queues(ndev); netif_tx_start_all_queues(ndev);
} }