diff options
author | Tomoya <tomoya-linux@dsn.okisemi.com> | 2010-12-21 22:00:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-22 18:25:40 -0500 |
commit | f622691c91cd1bb27d03a5caa8a43822572c62bc (patch) | |
tree | 7108157be97d54d4ad584a18f3067d206ba1c3ae | |
parent | ee09b3c1cff0335137dc1b146488e4352f640f13 (diff) |
pch_can: Fix array miss-pointing issue
Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/can/pch_can.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c index 8d45fdd0180d..c42e97268248 100644 --- a/drivers/net/can/pch_can.c +++ b/drivers/net/can/pch_can.c | |||
@@ -1078,15 +1078,17 @@ static int pch_can_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1078 | 1078 | ||
1079 | /* Save Tx buffer enable state */ | 1079 | /* Save Tx buffer enable state */ |
1080 | for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) | 1080 | for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) |
1081 | priv->tx_enable[i] = pch_can_get_rxtx_ir(priv, i, PCH_TX_IFREG); | 1081 | priv->tx_enable[i - 1] = pch_can_get_rxtx_ir(priv, i, |
1082 | PCH_TX_IFREG); | ||
1082 | 1083 | ||
1083 | /* Disable all Transmit buffers */ | 1084 | /* Disable all Transmit buffers */ |
1084 | pch_can_set_tx_all(priv, 0); | 1085 | pch_can_set_tx_all(priv, 0); |
1085 | 1086 | ||
1086 | /* Save Rx buffer enable state */ | 1087 | /* Save Rx buffer enable state */ |
1087 | for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) { | 1088 | for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) { |
1088 | priv->rx_enable[i] = pch_can_get_rxtx_ir(priv, i, PCH_RX_IFREG); | 1089 | priv->rx_enable[i - 1] = pch_can_get_rxtx_ir(priv, i, |
1089 | priv->rx_link[i] = pch_can_get_rx_buffer_link(priv, i); | 1090 | PCH_RX_IFREG); |
1091 | priv->rx_link[i - 1] = pch_can_get_rx_buffer_link(priv, i); | ||
1090 | } | 1092 | } |
1091 | 1093 | ||
1092 | /* Disable all Receive buffers */ | 1094 | /* Disable all Receive buffers */ |
@@ -1139,15 +1141,15 @@ static int pch_can_resume(struct pci_dev *pdev) | |||
1139 | 1141 | ||
1140 | /* Enabling the transmit buffer. */ | 1142 | /* Enabling the transmit buffer. */ |
1141 | for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) | 1143 | for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) |
1142 | pch_can_set_rxtx(priv, i, priv->tx_enable[i], PCH_TX_IFREG); | 1144 | pch_can_set_rxtx(priv, i, priv->tx_enable[i - 1], PCH_TX_IFREG); |
1143 | 1145 | ||
1144 | /* Configuring the receive buffer and enabling them. */ | 1146 | /* Configuring the receive buffer and enabling them. */ |
1145 | for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) { | 1147 | for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) { |
1146 | /* Restore buffer link */ | 1148 | /* Restore buffer link */ |
1147 | pch_can_set_rx_buffer_link(priv, i, priv->rx_link[i]); | 1149 | pch_can_set_rx_buffer_link(priv, i, priv->rx_link[i - 1]); |
1148 | 1150 | ||
1149 | /* Restore buffer enables */ | 1151 | /* Restore buffer enables */ |
1150 | pch_can_set_rxtx(priv, i, priv->rx_enable[i], PCH_RX_IFREG); | 1152 | pch_can_set_rxtx(priv, i, priv->rx_enable[i - 1], PCH_RX_IFREG); |
1151 | } | 1153 | } |
1152 | 1154 | ||
1153 | /* Enable CAN Interrupts */ | 1155 | /* Enable CAN Interrupts */ |