aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-11-04can: rx-offload: can_rx_offload_offload_one(): do not increase the skb_queue beyond skb_queue_len_maxMarc Kleine-Budde1-1/+1
The skb_queue is a linked list, holding the skb to be processed in the next NAPI call. Without this patch, the queue length in can_rx_offload_offload_one() is limited to skb_queue_len_max + 1. As the skb_queue is a linked list, no array or other resources are accessed out-of-bound, however this behaviour is counterintuitive. This patch limits the rx-offload skb_queue length to skb_queue_len_max. Fixes: d254586c3453 ("can: rx-offload: Add support for HW fifo based irq offloading") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: rx-offload: can_rx_offload_queue_tail(): fix error handling, avoid skb mem leakMarc Kleine-Budde1-2/+4
If the rx-offload skb_queue is full can_rx_offload_queue_tail() will not queue the skb and return with an error. This patch frees the skb in case of a full queue, which brings can_rx_offload_queue_tail() in line with the can_rx_offload_queue_sorted() function, which has been adjusted in the previous patch. The return value is adjusted to -ENOBUFS to better reflect the actual problem. The device stats handling is left to the caller. Fixes: d254586c3453 ("can: rx-offload: Add support for HW fifo based irq offloading") Reported-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: rx-offload: can_rx_offload_queue_sorted(): fix error handling, avoid skb mem leakMarc Kleine-Budde1-2/+4
If the rx-offload skb_queue is full can_rx_offload_queue_sorted() will not queue the skb and return with an error. None of the callers of this function, issue a kfree_skb() to free the not queued skb. This results in a memory leak. This patch fixes the problem by freeing the skb in case of a full queue. The return value is adjusted to -ENOBUFS to better reflect the actual problem. The device stats handling is left to the callers, as this function might be used in both the rx and tx path. Fixes: 55059f2b7f86 ("can: rx-offload: introduce can_rx_offload_get_echo_skb() and can_rx_offload_queue_sorted() functions") Cc: linux-stable <stable@vger.kernel.org> Cc: Martin Hundebøll <martin@geanix.com> Reported-by: Martin Hundebøll <martin@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: xilinx_can: Fix flags field initialization for axi canAppana Durga Kedareswara rao1-1/+0
AXI CANIP doesn't support tx fifo empty interrupt feature(TXFEMP), update the flags filed in the driver for AXI CAN case accordingly. Fixes: 3281b380ec9f ("can: xilinx_can: Fix flags field initialization for axi can and canps") Reported-by: Anssi Hannula <anssi.hannula@bitwise.fi> Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: c_can: C_CAN: add bus recovery eventsJeroen Hofstee1-2/+18
While the state is updated when the error counters increase and decrease, there is no event when the bus recovers and the error counters decrease again. So add that event as well. Change the state going downward to be ERROR_PASSIVE -> ERROR_WARNING -> ERROR_ACTIVE instead of directly to ERROR_ACTIVE again. Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com> Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Tested-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: c_can: D_CAN: c_can_chip_config(): perform a sofware reset on openJeroen Hofstee1-0/+26
When the CAN interface is closed it the hardwre is put in power down mode, but does not reset the error counters / state. Reset the D_CAN on open, so the reported state and the actual state match. According to [1], the C_CAN module doesn't have the software reset. [1] http://www.bosch-semiconductors.com/media/ip_modules/pdf_2/c_can_fd8/users_manual_c_can_fd8_r210_1.pdf Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: c_can: c_can_poll(): only read status register after status IRQKurt Van Dijck2-5/+21
When the status register is read without the status IRQ pending, the chip may not raise the interrupt line for an upcoming status interrupt and the driver may miss a status interrupt. It is critical that the BUSOFF status interrupt is forwarded to the higher layers, since no more interrupts will follow without intervention. Thanks to Wolfgang and Joe for bringing up the first idea. Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Joe Burmeister <joe.burmeister@devtank.co.uk> Fixes: fa39b54ccf28 ("can: c_can: Get rid of pointless interrupts") Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: peak_usb: report bus recovery as wellJeroen Hofstee1-5/+10
While the state changes are reported when the error counters increase and decrease, there is no event when the bus recovers and the error counters decrease again. So add those as well. Change the state going downward to be ERROR_PASSIVE -> ERROR_WARNING -> ERROR_ACTIVE instead of directly to ERROR_ACTIVE again. Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com> Cc: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: peak_usb: fix slab info leakJohan Hovold1-1/+1
Fix a small slab info leak due to a failure to clear the command buffer at allocation. The first 16 bytes of the command buffer are always sent to the device in pcan_usb_send_cmd() even though only the first two may have been initialised in case no argument payload is provided (e.g. when waiting for a response). Fixes: bb4785551f64 ("can: usb: PEAK-System Technik USB adapters driver core") Cc: stable <stable@vger.kernel.org> # 3.4 Reported-by: syzbot+863724e7128e14b26732@syzkaller.appspotmail.com Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: peak_usb: fix a potential out-of-sync while decoding packetsStephane Grosjean1-5/+12
When decoding a buffer received from PCAN-USB, the first timestamp read in a packet is a 16-bit coded time base, and the next ones are an 8-bit offset to this base, regardless of the type of packet read. This patch corrects a potential loss of synchronization by using a timestamp index read from the buffer, rather than an index of received data packets, to determine on the sizeof the timestamp to be read from the packet being decoded. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Fixes: 46be265d3388 ("can: usb: PEAK-System Technik PCAN-USB specific part") Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: flexcan: disable completely the ECC mechanismJoakim Zhang1-0/+1
The ECC (memory error detection and correction) mechanism can be activated or not, controlled by the ECCDIS bit in CAN_MECR. When disabled, updates on indications and reporting registers are stopped. So if want to disable ECC completely, had better assert ECCDIS bit, not just mask the related interrupts. Fixes: cdce844865be ("can: flexcan: add vf610 support for FlexCAN") Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: usb_8dev: fix use-after-free on disconnectJohan Hovold1-2/+1
The driver was accessing its driver data after having freed it. Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices") Cc: stable <stable@vger.kernel.org> # 3.9 Cc: Bernd Krumboeck <b.krumboeck@gmail.com> Cc: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: mcba_usb: fix use-after-free on disconnectJohan Hovold1-2/+1
The driver was accessing its driver data after having freed it. Fixes: 51f3baad7de9 ("can: mcba_usb: Add support for Microchip CAN BUS Analyzer") Cc: stable <stable@vger.kernel.org> # 4.12 Cc: Remigiusz Kołłątaj <remigiusz.kollataj@mobica.com> Reported-by: syzbot+e29b17e5042bbc56fae9@syzkaller.appspotmail.com Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: gs_usb: gs_can_open(): prevent memory leakNavid Emamdoost1-0/+1
In gs_can_open() if usb_submit_urb() fails the allocated urb should be released. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-11-04can: dev: add missing of_node_put() after calling of_get_child_by_name()Wen Yang1-0/+1
of_node_put() needs to be called when the device node which is got from of_get_child_by_name() finished using. Fixes: 2290aefa2e90 ("can: dev: Add support for limiting configured bitrate") Cc: Franklin S Cooper Jr <fcooper@ti.com> Signed-off-by: Wen Yang <wenyang@linux.alibaba.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-26drivers: net: Fix Kconfig indentationKrzysztof Kozlowski1-4/+4
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Kalle Valo <kvalo@codeaurora.org> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-05Merge tag 'linux-can-next-for-5.4-20190904' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-nextDavid S. Miller4-8/+33
Marc Kleine-Budde says: ==================== pull-request: can-next 2019-09-04 j1939 this is a pull request for net-next/master consisting of 21 patches. the first 12 patches are by me and target the CAN core infrastructure. They clean up the names of variables , structs and struct members, convert can_rx_register() to use max() instead of open coding it and remove unneeded code from the can_pernet_exit() callback. The next three patches are also by me and they introduce and make use of the CAN midlayer private structure. It is used to hold protocol specific per device data structures. The next patch is by Oleksij Rempel, switches the &net->can.rcvlists_lock from a spin_lock() to a spin_lock_bh(), so that it can be used from NAPI (soft IRQ) context. The next 4 patches are by Kurt Van Dijck, he first updates his email address via mailmap and then extends sockaddr_can to include j1939 members. The final patch is the collective effort of many entities (The j1939 authors: Oliver Hartkopp, Bastian Stender, Elenita Hinds, kbuild test robot, Kurt Van Dijck, Maxime Jayat, Robin van der Gracht, Oleksij Rempel, Marc Kleine-Budde). It adds support of SAE J1939 protocol to the CAN networking stack. SAE J1939 is the vehicle bus recommended practice used for communication and diagnostics among vehicle components. Originating in the car and heavy-duty truck industry in the United States, it is now widely used in other parts of the world. P.S.: This pull request doesn't invalidate my last pull request: "pull-request: can-next 2019-09-03". ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-04can: make use of preallocated can_ml_priv for per device struct can_dev_rcv_listsMarc Kleine-Budde4-0/+5
This patch removes the old method of allocating the per device protocol specific memory via a netdevice_notifier. This had the drawback, that the allocation can fail, leading to a lot of null pointer checks in the code. This also makes the live cycle management of this memory quite complicated. This patch switches from the allocating the struct can_dev_rcv_lists in a NETDEV_REGISTER call to using the dev->ml_priv, which is allocated by the driver since the previous patch. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-04can: introduce CAN midlayer private and allocate it automaticallyMarc Kleine-Budde4-8/+28
This patch introduces the CAN midlayer private structure ("struct can_ml_priv") which should be used to hold protocol specific per device data structures. For now it's only member is "struct can_dev_rcv_lists". The CAN midlayer private is allocated via alloc_netdev()'s private and assigned to "struct net_device::ml_priv" during device creation. This is done transparently for CAN drivers using alloc_candev(). The slcan, vcan and vxcan drivers which are not using alloc_candev() have been adopted manually. The memory layout of the netdev_priv allocated via alloc_candev() will looke like this: +-------------------------+ | driver's priv | +-------------------------+ | struct can_ml_priv | +-------------------------+ | array of struct sk_buff | +-------------------------+ Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: dev: can_dev_init(): convert from printk(KERN_INFO) to pr_infoMarc Kleine-Budde1-1/+1
This patch converts the printk(KERN_INFO) in can_dev_init() to pr_info(). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: dev: can_dellink(): remove return at end of void functionMarc Kleine-Budde1-1/+0
This patch remove the return at the end of the void function can_dellink(). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: dev: can_restart(): convert NULL pointer checkMarc Kleine-Budde1-1/+1
This patch converts the NULL pointer check in can_restart() form "skb == NULL" to "!skb". Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: dev: remove unnecessary blank lineMarc Kleine-Budde1-1/+0
This patch removes unnecessary blank lines, so that checkpatch doesn't complain anymore. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: dev: remove unnecessary parenthesesMarc Kleine-Budde1-5/+5
This patch removes unnecessary parentheses from the generic CAN device infrastructure. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: dev: avoid long linesMarc Kleine-Budde1-16/+27
This patch fixes long lines in the generic CAN device infrastructure. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: dev: convert block comments to network style commentsMarc Kleine-Budde1-52/+24
This patch converts all block comments to network subsystem style block comments. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: mcp251x: Call wrapper instead of regulator_disable()Andy Shevchenko1-4/+2
There is no need to check for regulator presence in the ->suspend() since a wrapper does it for us. Due to this we may unconditionally set AFTER_SUSPEND_POWER flag. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: mcp251x: Make use of device property APIAndy Shevchenko1-7/+5
Make use of device property API in this driver so that both OF based system and ACPI based system can use this driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: mcp251x: Use devm_clk_get_optional() to get the input clockAndy Shevchenko1-18/+12
Simplify the code which fetches the input clock by using devm_clk_get_optional(). This comes with a small functional change: previously all errors were ignored when platform data is present. Now all errors are treated as errors. If no input clock is present devm_clk_get_optional() will return NULL instead of an error which matches the behavior of the old code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: mcp251x: remove deprecated board file setup exampleMarc Kleine-Budde1-20/+0
In the pre device-tree ARM aera there were board files that configured the system (instead of a device tree). A "struct spi_board_info" was used to describe the SPI bus. As new systems should be described via device trees, this patch removes the board setup example from the driver. The "struct mcp251x_platform_data" cannot be removed completely, as there are still some in-tree users of this file. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: tcan4x5x: Remove checking the wake pinDan Murphy1-13/+0
Remove checking the wake pin for every read/write call. The device is not explicitly put to sleep in the code and the POR interrupt is cleared during the init of the device. Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: tcan4x5x: Remove data-ready gpio interruptDan Murphy1-10/+1
Remove the data-ready gpio interrupt handling and use the spi->irq that is created based on the interrupt DT property. Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-09-03can: kvaser_pciefd: the PWM generator is running at the bus frequency of the system.Christer Beskow1-1/+5
The system clock frequency for the bus connected to the PCIe controller shall be used when calculating the frequency of the PWM, not the CAN system clock frequency. Signed-off-by: Christer Beskow <chbe@kvaser.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-22can: Delete unnecessary checks before the macro call “dev_kfree_skb”Markus Elfring2-4/+2
The dev_kfree_skb() function performs also input parameter validation. Thus the test around the shown calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-20can: mcp251x: remove custom DMA mapped bufferMarc Kleine-Budde1-48/+10
There is no need to duplicate what SPI core already does, i.e. mapping buffers for DMA capable transfers. This patch removes all related pices of code. Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: Use DT-supplied interrupt flagsPhil Elwell1-1/+4
The MCP2515 datasheet clearly describes a level-triggered interrupt pin. Therefore the receiving interrupt controller must also be configured for level-triggered operation otherwise there is a danger of a missed interrupt condition blocking all subsequent interrupts. The ONESHOT flag ensures that the interrupt is masked until the threaded interrupt handler exits. Rather than change the flags globally (they must have worked for at least one user), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: https://github.com/raspberrypi/linux/issues/2175 https://github.com/raspberrypi/linux/issues/2263 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: Use dev_name() during request_threaded_irq()Alexander Shiyan1-1/+2
Passing driver name as name during request_threaded_irq() results in all CAN IRQs have same name. This does not help much to easily identify which IRQ belongs to which CAN instance. Therefore pass dev_name() during request_threaded_irq() so that better identifiable name is listed for CAN devices in cat /proc/interrupts output. Output of cat /proc/interrupts Before this patch: 253: 2 gpio-mxc 13 Edge mcp251x 259: 2 gpio-mxc 19 Edge mcp251x After this patch: 253: 2 gpio-mxc 13 Edge spi1.1 259: 2 gpio-mxc 19 Edge spi1.2 Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: mcp251x_hw_reset(): allow more time after a resetMarc Kleine-Budde1-5/+14
Some boards take longer than 5ms to power up after a reset, so allow some retries attempts before giving up. Fixes: ff06d611a31c ("can: mcp251x: Improve mcp251x_hw_reset()") Cc: linux-stable <stable@vger.kernel.org> Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: use u8 instead of uint8_tMarc Kleine-Budde1-5/+4
This patch changes all the uint8_t in the arguments in several function to u8. Acked-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: fix print formating stringsMarc Kleine-Budde1-2/+1
This patch fixes the print format strings in the driver. Acked-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: avoid long linesMarc Kleine-Budde1-2/+4
This patch fixes long lines in the driver. Acked-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: remove unnecessary blank linesMarc Kleine-Budde1-2/+0
This patch removes unnecessary blank lines, so that checkpatch doesn't complain anymore. Acked-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: mcp251x: convert block comments to network style commentsMarc Kleine-Budde1-10/+5
This patch converts all block comments to network subsystem style block comments. Acked-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: m_can_platform: m_can_plat_probe(): add missing error handling if mcan_class is NULLMarc Kleine-Budde1-0/+3
This patch adds the missing error handling in m_can_plat_probe() if mcan_class is NULL. Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: m_can_platform: remove not needed casts to struct m_can_plat_priv *Marc Kleine-Budde1-8/+4
The struct m_can_classdev::device_data is a void pointer, so there's no need to cast it to struct m_can_plat_priv *, when assigning the struct m_can_plat_priv pointer. This patch removes the not needed casts from the m_can_platform driver. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: tcan4x5x: fix data length in regmap write pathMarc Kleine-Budde1-2/+2
In regmap_spi_gather_write() the "addr" is prepared. The chip expects the number of 32 bit words to write in the lower 8 bits of addr. However the number of byte to write in shifted left by 3 (== divided by 8). The function tcan4x5x_regmap_write() is called with a data buffer, which holds the register information in the first 32 bits, followed by the actual data. tcan4x5x_regmap_write() calls regmap_spi_gather_write() with the val pointer pointing to the actual data (i.e. the original pointer is incremented by 4 bytes), but without decrementing the count. If the regmap framework only calls tcan4x5x_regmap_write() to read single 32 bit registers these two bugs cancel each other. This patch fixes the code. Fixes: 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: tcan4x5x: tcan4x5x_can_probe(): add missing error handling if mcan_class is NULLMarc Kleine-Budde1-0/+3
This patch adds the missing error handling in tcan4x5x_can_probe() if mcan_class is NULL. Fixes: 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: tcan4x5x: remove not needed casts to struct tcan4x5x_priv *Marc Kleine-Budde1-13/+8
The struct m_can_classdev::device_data is a void pointer, so there's no need to cast it to struct tcan4x5x_priv *, when assigning the struct tcan4x5x_priv pointer. This patch removes the not needed casts from the tcan4x5x driver. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: tcan4x5x: remove unused struct tcan4x5x_priv::tcan4x5x_lockMarc Kleine-Budde1-3/+0
The mutex struct tcan4x5x_priv::tcan4x5x_lock is unused in the driver, so this patch removes the variable from the driver. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-08-20can: hi311x: remove custom DMA mapped bufferMarc Kleine-Budde1-49/+10
There is no need to duplicate what SPI core already does, i.e. mapping buffers for DMA capable transfers. This patch removes all related pices of code. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>