aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-12-19 15:13:14 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-19 15:13:14 -0500
commitde47c4ab25d43a98e629cc11c2d90ae56145b35d (patch)
treefb45b6c3a08658cb39203366f70469c0610e0f9a /drivers/net/can
parentb89587a7af4b2a2e0682c304224be4041e993548 (diff)
parent21629e1a118402566dce08f26edf19954fecef32 (diff)
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
Marc Kleine-Budde says: ==================== this is a pull request of four patches for net-next/master. There is one patch by Markus Pargmann, which speeds up the c_can driver, a patch by John Whitmore which updates the in tree documentation. A patch by Jeff Kirsher which replaces the FSF's address by a link and a patch by Alexander Shiyan which converts the mcp251x driver to make use of managed resources. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/c_can/c_can.c22
-rw-r--r--drivers/net/can/dev.c3
-rw-r--r--drivers/net/can/mcp251x.c22
-rw-r--r--drivers/net/can/mscan/mpc5xxx_can.c3
-rw-r--r--drivers/net/can/mscan/mscan.c3
-rw-r--r--drivers/net/can/mscan/mscan.h3
-rw-r--r--drivers/net/can/pch_can.c3
-rw-r--r--drivers/net/can/sja1000/ems_pci.c3
-rw-r--r--drivers/net/can/sja1000/kvaser_pci.c3
-rw-r--r--drivers/net/can/sja1000/plx_pci.c3
-rw-r--r--drivers/net/can/sja1000/sja1000_isa.c3
-rw-r--r--drivers/net/can/sja1000/sja1000_of_platform.c3
-rw-r--r--drivers/net/can/sja1000/sja1000_platform.c3
-rw-r--r--drivers/net/can/slcan.c4
-rw-r--r--drivers/net/can/softing/softing_cs.c3
-rw-r--r--drivers/net/can/softing/softing_fw.c3
-rw-r--r--drivers/net/can/softing/softing_main.c3
17 files changed, 34 insertions, 56 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 77061eebb034..951bfede8f3d 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -808,17 +808,19 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
808 u32 num_rx_pkts = 0; 808 u32 num_rx_pkts = 0;
809 unsigned int msg_obj, msg_ctrl_save; 809 unsigned int msg_obj, msg_ctrl_save;
810 struct c_can_priv *priv = netdev_priv(dev); 810 struct c_can_priv *priv = netdev_priv(dev);
811 u32 val = c_can_read_reg32(priv, C_CAN_INTPND1_REG); 811 u16 val;
812
813 /*
814 * It is faster to read only one 16bit register. This is only possible
815 * for a maximum number of 16 objects.
816 */
817 BUILD_BUG_ON_MSG(C_CAN_MSG_OBJ_RX_LAST > 16,
818 "Implementation does not support more message objects than 16");
819
820 while (quota > 0 && (val = priv->read_reg(priv, C_CAN_INTPND1_REG))) {
821 while ((msg_obj = ffs(val)) && quota > 0) {
822 val &= ~BIT(msg_obj - 1);
812 823
813 for (msg_obj = C_CAN_MSG_OBJ_RX_FIRST;
814 msg_obj <= C_CAN_MSG_OBJ_RX_LAST && quota > 0;
815 val = c_can_read_reg32(priv, C_CAN_INTPND1_REG),
816 msg_obj++) {
817 /*
818 * as interrupt pending register's bit n-1 corresponds to
819 * message object n, we need to handle the same properly.
820 */
821 if (val & (1 << (msg_obj - 1))) {
822 c_can_object_get(dev, 0, msg_obj, IF_COMM_ALL & 824 c_can_object_get(dev, 0, msg_obj, IF_COMM_ALL &
823 ~IF_COMM_TXRQST); 825 ~IF_COMM_TXRQST);
824 msg_ctrl_save = priv->read_reg(priv, 826 msg_ctrl_save = priv->read_reg(priv,
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index bda1888cae9a..13a909822e25 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19 18
20#include <linux/module.h> 19#include <linux/module.h>
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 08ac401e0214..88d3877b6277 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -28,8 +28,7 @@
28 * GNU General Public License for more details. 28 * GNU General Public License for more details.
29 * 29 *
30 * You should have received a copy of the GNU General Public License 30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software 31 * along with this program; if not, see <http://www.gnu.org/licenses/>.
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 * 32 *
34 * 33 *
35 * 34 *
@@ -1067,15 +1066,17 @@ static int mcp251x_can_probe(struct spi_device *spi)
1067 1066
1068 /* Allocate non-DMA buffers */ 1067 /* Allocate non-DMA buffers */
1069 if (!mcp251x_enable_dma) { 1068 if (!mcp251x_enable_dma) {
1070 priv->spi_tx_buf = kmalloc(SPI_TRANSFER_BUF_LEN, GFP_KERNEL); 1069 priv->spi_tx_buf = devm_kzalloc(&spi->dev, SPI_TRANSFER_BUF_LEN,
1070 GFP_KERNEL);
1071 if (!priv->spi_tx_buf) { 1071 if (!priv->spi_tx_buf) {
1072 ret = -ENOMEM; 1072 ret = -ENOMEM;
1073 goto error_tx_buf; 1073 goto error_probe;
1074 } 1074 }
1075 priv->spi_rx_buf = kmalloc(SPI_TRANSFER_BUF_LEN, GFP_KERNEL); 1075 priv->spi_rx_buf = devm_kzalloc(&spi->dev, SPI_TRANSFER_BUF_LEN,
1076 GFP_KERNEL);
1076 if (!priv->spi_rx_buf) { 1077 if (!priv->spi_rx_buf) {
1077 ret = -ENOMEM; 1078 ret = -ENOMEM;
1078 goto error_rx_buf; 1079 goto error_probe;
1079 } 1080 }
1080 } 1081 }
1081 1082
@@ -1108,12 +1109,6 @@ static int mcp251x_can_probe(struct spi_device *spi)
1108 return ret; 1109 return ret;
1109 1110
1110error_probe: 1111error_probe:
1111 if (!mcp251x_enable_dma)
1112 kfree(priv->spi_rx_buf);
1113error_rx_buf:
1114 if (!mcp251x_enable_dma)
1115 kfree(priv->spi_tx_buf);
1116error_tx_buf:
1117 if (mcp251x_enable_dma) 1112 if (mcp251x_enable_dma)
1118 dma_free_coherent(&spi->dev, PAGE_SIZE, 1113 dma_free_coherent(&spi->dev, PAGE_SIZE,
1119 priv->spi_tx_buf, priv->spi_tx_dma); 1114 priv->spi_tx_buf, priv->spi_tx_dma);
@@ -1136,9 +1131,6 @@ static int mcp251x_can_remove(struct spi_device *spi)
1136 if (mcp251x_enable_dma) { 1131 if (mcp251x_enable_dma) {
1137 dma_free_coherent(&spi->dev, PAGE_SIZE, 1132 dma_free_coherent(&spi->dev, PAGE_SIZE,
1138 priv->spi_tx_buf, priv->spi_tx_dma); 1133 priv->spi_tx_buf, priv->spi_tx_dma);
1139 } else {
1140 kfree(priv->spi_tx_buf);
1141 kfree(priv->spi_rx_buf);
1142 } 1134 }
1143 1135
1144 mcp251x_power_enable(priv->power, 0); 1136 mcp251x_power_enable(priv->power, 0);
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index e59b3a392af6..035e235e3118 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -16,8 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 20 */
22 21
23#include <linux/kernel.h> 22#include <linux/kernel.h>
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index a955ec8c4b97..b9f3faabb0f3 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -16,8 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 20 */
22 21
23#include <linux/kernel.h> 22#include <linux/kernel.h>
diff --git a/drivers/net/can/mscan/mscan.h b/drivers/net/can/mscan/mscan.h
index e98abb97a050..ad8e08f9c496 100644
--- a/drivers/net/can/mscan/mscan.h
+++ b/drivers/net/can/mscan/mscan.h
@@ -14,8 +14,7 @@
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 18 */
20 19
21#ifndef __MSCAN_H__ 20#ifndef __MSCAN_H__
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index 5f0e9b3bfa7b..79e8699fd35a 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -12,8 +12,7 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17 */ 16 */
18 17
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
diff --git a/drivers/net/can/sja1000/ems_pci.c b/drivers/net/can/sja1000/ems_pci.c
index 835921388e7b..d790b874ca79 100644
--- a/drivers/net/can/sja1000/ems_pci.c
+++ b/drivers/net/can/sja1000/ems_pci.c
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation, 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */ 17 */
19 18
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/drivers/net/can/sja1000/kvaser_pci.c b/drivers/net/can/sja1000/kvaser_pci.c
index 087b13bd300e..c96eb14699d5 100644
--- a/drivers/net/can/sja1000/kvaser_pci.c
+++ b/drivers/net/can/sja1000/kvaser_pci.c
@@ -26,8 +26,7 @@
26 * General Public License for more details. 26 * General Public License for more details.
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software Foundation, 29 * along with this program; if not, see <http://www.gnu.org/licenses/>.
30 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 */ 30 */
32 31
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c
index f9b4f81cd86a..5df7f9848823 100644
--- a/drivers/net/can/sja1000/plx_pci.c
+++ b/drivers/net/can/sja1000/plx_pci.c
@@ -16,8 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation, 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */ 20 */
22 21
23#include <linux/kernel.h> 22#include <linux/kernel.h>
diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c
index 06a282397fff..df136a2516c4 100644
--- a/drivers/net/can/sja1000/sja1000_isa.c
+++ b/drivers/net/can/sja1000/sja1000_isa.c
@@ -11,8 +11,7 @@
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License 13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software 14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */ 15 */
17 16
18#include <linux/kernel.h> 17#include <linux/kernel.h>
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
index 047accd4ede5..2f6e24534231 100644
--- a/drivers/net/can/sja1000/sja1000_of_platform.c
+++ b/drivers/net/can/sja1000/sja1000_of_platform.c
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation, 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */ 17 */
19 18
20/* This is a generic driver for SJA1000 chips on the OpenFirmware platform 19/* This is a generic driver for SJA1000 chips on the OpenFirmware platform
diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
index 29f9b6321187..943df645b459 100644
--- a/drivers/net/can/sja1000/sja1000_platform.c
+++ b/drivers/net/can/sja1000/sja1000_platform.c
@@ -12,8 +12,7 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 16 */
18 17
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index 25377e547f9b..3fcdae266377 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -18,9 +18,7 @@
18 * General Public License for more details. 18 * General Public License for more details.
19 * 19 *
20 * You should have received a copy of the GNU General Public License along 20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc., 21 * with this program; if not, see http://www.gnu.org/licenses/gpl.html
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307. You can also get it
23 * at http://www.gnu.org/licenses/gpl.html
24 * 22 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c
index 498605f833dd..cdc0c7433a4b 100644
--- a/drivers/net/can/softing/softing_cs.c
+++ b/drivers/net/can/softing/softing_cs.c
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19 18
20#include <linux/module.h> 19#include <linux/module.h>
diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c
index b595d3422b9f..52fe50725d74 100644
--- a/drivers/net/can/softing/softing_fw.c
+++ b/drivers/net/can/softing/softing_fw.c
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19 18
20#include <linux/firmware.h> 19#include <linux/firmware.h>
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 6cd5c01b624d..1b8212783640 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19 18
20#include <linux/module.h> 19#include <linux/module.h>