Commit f622691c authored by Tomoya's avatar Tomoya Committed by David S. Miller

pch_can: Fix array miss-pointing issue

Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee09b3c1
...@@ -1078,15 +1078,17 @@ static int pch_can_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -1078,15 +1078,17 @@ static int pch_can_suspend(struct pci_dev *pdev, pm_message_t state)
/* Save Tx buffer enable state */ /* Save Tx buffer enable state */
for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
priv->tx_enable[i] = pch_can_get_rxtx_ir(priv, i, PCH_TX_IFREG); priv->tx_enable[i - 1] = pch_can_get_rxtx_ir(priv, i,
PCH_TX_IFREG);
/* Disable all Transmit buffers */ /* Disable all Transmit buffers */
pch_can_set_tx_all(priv, 0); pch_can_set_tx_all(priv, 0);
/* Save Rx buffer enable state */ /* Save Rx buffer enable state */
for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) { for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
priv->rx_enable[i] = pch_can_get_rxtx_ir(priv, i, PCH_RX_IFREG); priv->rx_enable[i - 1] = pch_can_get_rxtx_ir(priv, i,
priv->rx_link[i] = pch_can_get_rx_buffer_link(priv, i); PCH_RX_IFREG);
priv->rx_link[i - 1] = pch_can_get_rx_buffer_link(priv, i);
} }
/* Disable all Receive buffers */ /* Disable all Receive buffers */
...@@ -1139,15 +1141,15 @@ static int pch_can_resume(struct pci_dev *pdev) ...@@ -1139,15 +1141,15 @@ static int pch_can_resume(struct pci_dev *pdev)
/* Enabling the transmit buffer. */ /* Enabling the transmit buffer. */
for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
pch_can_set_rxtx(priv, i, priv->tx_enable[i], PCH_TX_IFREG); pch_can_set_rxtx(priv, i, priv->tx_enable[i - 1], PCH_TX_IFREG);
/* Configuring the receive buffer and enabling them. */ /* Configuring the receive buffer and enabling them. */
for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) { for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
/* Restore buffer link */ /* Restore buffer link */
pch_can_set_rx_buffer_link(priv, i, priv->rx_link[i]); pch_can_set_rx_buffer_link(priv, i, priv->rx_link[i - 1]);
/* Restore buffer enables */ /* Restore buffer enables */
pch_can_set_rxtx(priv, i, priv->rx_enable[i], PCH_RX_IFREG); pch_can_set_rxtx(priv, i, priv->rx_enable[i - 1], PCH_RX_IFREG);
} }
/* Enable CAN Interrupts */ /* Enable CAN Interrupts */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment