Commit de47c4ab authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents b89587a7 21629e1a
This diff is collapsed.
...@@ -2008,6 +2008,7 @@ L: linux-can@vger.kernel.org ...@@ -2008,6 +2008,7 @@ L: linux-can@vger.kernel.org
W: http://gitorious.org/linux-can W: http://gitorious.org/linux-can
T: git git://gitorious.org/linux-can/linux-can-next.git T: git git://gitorious.org/linux-can/linux-can-next.git
S: Maintained S: Maintained
F: Documentation/networking/can.txt
F: net/can/ F: net/can/
F: include/linux/can/core.h F: include/linux/can/core.h
F: include/uapi/linux/can.h F: include/uapi/linux/can.h
......
...@@ -808,17 +808,19 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota) ...@@ -808,17 +808,19 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
u32 num_rx_pkts = 0; u32 num_rx_pkts = 0;
unsigned int msg_obj, msg_ctrl_save; unsigned int msg_obj, msg_ctrl_save;
struct c_can_priv *priv = netdev_priv(dev); struct c_can_priv *priv = netdev_priv(dev);
u32 val = c_can_read_reg32(priv, C_CAN_INTPND1_REG); u16 val;
for (msg_obj = C_CAN_MSG_OBJ_RX_FIRST;
msg_obj <= C_CAN_MSG_OBJ_RX_LAST && quota > 0;
val = c_can_read_reg32(priv, C_CAN_INTPND1_REG),
msg_obj++) {
/* /*
* as interrupt pending register's bit n-1 corresponds to * It is faster to read only one 16bit register. This is only possible
* message object n, we need to handle the same properly. * for a maximum number of 16 objects.
*/ */
if (val & (1 << (msg_obj - 1))) { BUILD_BUG_ON_MSG(C_CAN_MSG_OBJ_RX_LAST > 16,
"Implementation does not support more message objects than 16");
while (quota > 0 && (val = priv->read_reg(priv, C_CAN_INTPND1_REG))) {
while ((msg_obj = ffs(val)) && quota > 0) {
val &= ~BIT(msg_obj - 1);
c_can_object_get(dev, 0, msg_obj, IF_COMM_ALL & c_can_object_get(dev, 0, msg_obj, IF_COMM_ALL &
~IF_COMM_TXRQST); ~IF_COMM_TXRQST);
msg_ctrl_save = priv->read_reg(priv, msg_ctrl_save = priv->read_reg(priv,
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/module.h> #include <linux/module.h>
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* *
* *
...@@ -1067,15 +1066,17 @@ static int mcp251x_can_probe(struct spi_device *spi) ...@@ -1067,15 +1066,17 @@ static int mcp251x_can_probe(struct spi_device *spi)
/* Allocate non-DMA buffers */ /* Allocate non-DMA buffers */
if (!mcp251x_enable_dma) { if (!mcp251x_enable_dma) {
priv->spi_tx_buf = kmalloc(SPI_TRANSFER_BUF_LEN, GFP_KERNEL); priv->spi_tx_buf = devm_kzalloc(&spi->dev, SPI_TRANSFER_BUF_LEN,
GFP_KERNEL);
if (!priv->spi_tx_buf) { if (!priv->spi_tx_buf) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_tx_buf; goto error_probe;
} }
priv->spi_rx_buf = kmalloc(SPI_TRANSFER_BUF_LEN, GFP_KERNEL); priv->spi_rx_buf = devm_kzalloc(&spi->dev, SPI_TRANSFER_BUF_LEN,
GFP_KERNEL);
if (!priv->spi_rx_buf) { if (!priv->spi_rx_buf) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_rx_buf; goto error_probe;
} }
} }
...@@ -1108,12 +1109,6 @@ static int mcp251x_can_probe(struct spi_device *spi) ...@@ -1108,12 +1109,6 @@ static int mcp251x_can_probe(struct spi_device *spi)
return ret; return ret;
error_probe: error_probe:
if (!mcp251x_enable_dma)
kfree(priv->spi_rx_buf);
error_rx_buf:
if (!mcp251x_enable_dma)
kfree(priv->spi_tx_buf);
error_tx_buf:
if (mcp251x_enable_dma) if (mcp251x_enable_dma)
dma_free_coherent(&spi->dev, PAGE_SIZE, dma_free_coherent(&spi->dev, PAGE_SIZE,
priv->spi_tx_buf, priv->spi_tx_dma); priv->spi_tx_buf, priv->spi_tx_dma);
...@@ -1136,9 +1131,6 @@ static int mcp251x_can_remove(struct spi_device *spi) ...@@ -1136,9 +1131,6 @@ static int mcp251x_can_remove(struct spi_device *spi)
if (mcp251x_enable_dma) { if (mcp251x_enable_dma) {
dma_free_coherent(&spi->dev, PAGE_SIZE, dma_free_coherent(&spi->dev, PAGE_SIZE,
priv->spi_tx_buf, priv->spi_tx_dma); priv->spi_tx_buf, priv->spi_tx_dma);
} else {
kfree(priv->spi_tx_buf);
kfree(priv->spi_rx_buf);
} }
mcp251x_power_enable(priv->power, 0); mcp251x_power_enable(priv->power, 0);
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef __MSCAN_H__ #ifndef __MSCAN_H__
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <linux/interrupt.h> #include <linux/interrupt.h>
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation, * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation, * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation, * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation, * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/* This is a generic driver for SJA1000 chips on the OpenFirmware platform /* This is a generic driver for SJA1000 chips on the OpenFirmware platform
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, see http://www.gnu.org/licenses/gpl.html
* 59 Temple Place, Suite 330, Boston, MA 02111-1307. You can also get it
* at http://www.gnu.org/licenses/gpl.html
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/module.h> #include <linux/module.h>
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/firmware.h> #include <linux/firmware.h>
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/module.h> #include <linux/module.h>
......
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