aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/can
AgeCommit message (Collapse)AuthorFilesLines
2019-11-11can: mcp251x: only reset hardware as requiredTimo Schlüßler1-7/+44
This prevents unwanted glitches on the outputs when changing the link state of the can interface or when resuming from suspend. Only if the device is powered off during suspend it needs to be resetted as required by the specs. Signed-off-by: Timo Schlüßler <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-11can: mcp251x: add mcp251x_write_2regs() and make use of itTimo Schlüßler1-2/+13
This patch introduces the function mcp251x_write_2regs() to write two registers with one SPI transfer and converts the disabling of pending interrupts in mcp251x_stop() to it. Signed-off-by: Timo Schlüßler <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-11can: mcp251x: get rid of legacy platform dataAndy Shevchenko1-5/+4
Instead of using legacy platform data, switch to use device properties. For clock frequency we are using well established clock-frequency property. Users, two for now, are also converted here. Cc: Daniel Mack <[email protected]> Cc: Haojian Zhuang <[email protected]> Cc: Robert Jarzmik <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-11can: dev: can_restart(): remove unused codeGustavo A. R. Silva1-3/+2
Value assigned to variable err is overwritten at line 562: err = priv->do_set_mode(dev, CAN_MODE_START); before it can be used. Also, notice that this code has been there since 2014. Addresses-Coverity-ID: 1227031 Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-05can: mcp251x: mcp251x_restart_work_handler(): Fix potential force_quit race ↵Timo Schlüßler1-1/+1
condition In mcp251x_restart_work_handler() the variable to stop the interrupt handler (priv->force_quit) is reset after the chip is restarted and thus a interrupt might occur. This patch fixes the potential race condition by resetting force_quit before enabling interrupts. Signed-off-by: Timo Schlüßler <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: ti_hecc: add missing state changesJeroen Hofstee1-0/+17
While the ti_hecc has interrupts to report when the error counters increase to a certain level and which change state it doesn't handle the case that the error counters go down again, so the reported state can actually be wrong. Since there is no interrupt for that, do update state based on the error counters, when the state is not error active and goes down again. Signed-off-by: Jeroen Hofstee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: ti_hecc: properly report state changesJeroen Hofstee1-74/+88
The HECC_CANES register handles the flags specially, it only updates the flags after a one is written to them. Since the interrupt for frame errors is not enabled an old error can hence been seen when a state interrupt arrives. For example if the device is not connected to the CAN-bus the error warning interrupt will have HECC_CANES indicating there is no ack. The error passive interrupt thereafter will have HECC_CANES flagging that there is a warning level. And if thereafter there is a message successfully send HECC_CANES points to an error passive event, while in reality it became error warning again. In summary, the state is not always reported correctly. So handle the state changes and frame errors separately. The state changes are now based on the interrupt flags and handled directly when they occur. The reporting of the frame errors is still done as before, as a side effect of another interrupt. note: the hecc_clear_bit will do a read, modify, write. So it will not only clear the bit, but also reset all other bits being set as a side affect, hence it is replaced with only clearing the flags. note: The HECC_CANMC_CCR is no longer cleared in the state change interrupt, it is completely unrelated. And use net_ratelimit to make checkpatch happy. Signed-off-by: Jeroen Hofstee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: ti_hecc: add fifo overflow error reportingJeroen Hofstee1-5/+31
When the rx FIFO overflows the ti_hecc would silently drop them since the overwrite protection is enabled for all mailboxes. So disable it for the lowest priority mailbox and return a proper error value when receive message lost is set. Drop the message itself in that case, since it might be partially updated. Signed-off-by: Jeroen Hofstee <[email protected]> Acked-by: Jeroen Hofstee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: ti_hecc: release the mailbox a bit earlierJeroen Hofstee1-2/+3
Release the mailbox after reading it, so it can be reused a bit earlier. Since "can: rx-offload: continue on error" all pending message bits are cleared directly, so remove clearing them in ti_hecc. Suggested-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Jeroen Hofstee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: ti_hecc: keep MIM and MD setJeroen Hofstee1-3/+3
The HECC_CANMIM is set in the xmit path and cleared in the interrupt. Since this is done with a read, modify, write action the register might end up with some more MIM enabled then intended, since it is not protected. That doesn't matter at all, since the tx interrupt disables the mailbox with HECC_CANME (while holding a spinlock). So lets just always keep MIM set. While at it, since the mailbox direction never changes, don't set it every time a message is send, ti_hecc_reset() already sets them to tx. Signed-off-by: Jeroen Hofstee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: ti_hecc: ti_hecc_stop(): stop the CPK on downJeroen Hofstee1-0/+3
When the interface goes down, the CPK should no longer take an active part in the CAN-bus communication, like sending acks and error frames. So enable configuration mode in ti_hecc_stop, so the CPK is no longer active. When a transceiver switch is present the acks and errors don't make it to the bus, but disabling the CPK then does prevent oddities, like ti_hecc_reset() failing, since the CPK can become bus-off and starts counting the 11 bit recessive bits, which seems to block the reset. It can also cause invalid interrupts and disrupt the CAN-bus, since transmission can be stopped in the middle of a message, by disabling the tranceiver while the CPK is sending. Since the CPK is disabled after normal power on, it is typically only seen when the interface is restarted. Signed-off-by: Jeroen Hofstee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: ti_hecc: ti_hecc_error(): increase error counters if skb enqueueing via ↵Marc Kleine-Budde1-1/+4
can_rx_offload_queue_sorted() fails The call to can_rx_offload_queue_sorted() may fail and return an error (in the current implementation due to resource shortage). The passed skb is consumed. This patch adds incrementing of the appropriate error counters to let the device statistics reflect that there's a problem. Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: flexcan: increase error counters if skb enqueueing via ↵Marc Kleine-Budde1-2/+8
can_rx_offload_queue_sorted() fails The call to can_rx_offload_queue_sorted() may fail and return an error (in the current implementation due to resource shortage). The passed skb is consumed. This patch adds incrementing of the appropriate error counters to let the device statistics reflect that there's a problem. Reported-by: Martin Hundebøll <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: rx-offload: can_rx_offload_irq_offload_fifo(): continue on errorMarc Kleine-Budde1-1/+3
In case of a resource shortage, i.e. the rx_offload queue will overflow or a skb fails to be allocated (due to OOM), can_rx_offload_offload_one() will call mailbox_read() to discard the mailbox and return an ERR_PTR. If the hardware FIFO is empty can_rx_offload_offload_one() will return NULL. In case a CAN frame was read from the hardware, can_rx_offload_offload_one() returns the skb containing it. Without this patch can_rx_offload_irq_offload_fifo() bails out if no skb returned, regardless of the reason. Similar to can_rx_offload_irq_offload_timestamp() in case of a resource shortage the whole FIFO should be discarded, to avoid an IRQ storm and give the system some time to recover. However if the FIFO is empty the loop can be left. With this patch the loop is left in case of empty FIFO, but not on errors. Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: rx-offload: can_rx_offload_irq_offload_timestamp(): continue on errorJeroen Hofstee1-1/+1
In case of a resource shortage, i.e. the rx_offload queue will overflow or a skb fails to be allocated (due to OOM), can_rx_offload_offload_one() will call mailbox_read() to discard the mailbox and return an ERR_PTR. However can_rx_offload_irq_offload_timestamp() bails out in the error case. In case of a resource shortage all mailboxes should be discarded, to avoid an IRQ storm and give the system some time to recover. Since can_rx_offload_irq_offload_timestamp() is typically called from a while loop, all message will eventually be discarded. So let's continue on error instead to discard them directly. Signed-off-by: Jeroen Hofstee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: rx-offload: can_rx_offload_offload_one(): use ERR_PTR() to propagate ↵Marc Kleine-Budde1-13/+73
error value in case of errors Before this patch can_rx_offload_offload_one() returns a pointer to a skb containing the read CAN frame or a NULL pointer. However the meaning of the NULL pointer is ambiguous, it can either mean the requested mailbox is empty or there was an error. This patch fixes this situation by returning: - pointer to skb on success - NULL pointer if mailbox is empty - ERR_PTR() in case of an error All users of can_rx_offload_offload_one() have been adopted, no functional change intended. Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: rx-offload: can_rx_offload_offload_one(): increment rx_fifo_errors on ↵Marc Kleine-Budde1-1/+3
queue overflow or OOM If the rx-offload skb_queue is full or the skb allocation fails (due to OOM), the mailbox contents is discarded. This patch adds the incrementing of the rx_fifo_errors statistics counter. Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: rx-offload: can_rx_offload_offload_one(): do not increase the skb_queue ↵Marc Kleine-Budde1-1/+1
beyond skb_queue_len_max 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 <[email protected]>
2019-11-04can: rx-offload: can_rx_offload_queue_tail(): fix error handling, avoid skb ↵Marc Kleine-Budde1-2/+4
mem leak 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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-11-04can: rx-offload: can_rx_offload_queue_sorted(): fix error handling, avoid ↵Marc Kleine-Budde1-2/+4
skb mem leak 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 <[email protected]> Cc: Martin Hundebøll <[email protected]> Reported-by: Martin Hundebøll <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Appana Durga Kedareswara rao <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Acked-by: Kurt Van Dijck <[email protected]> Tested-by: Kurt Van Dijck <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Cc: Wolfgang Grandegger <[email protected]> Cc: Joe Burmeister <[email protected]> Fixes: fa39b54ccf28 ("can: c_can: Get rid of pointless interrupts") Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Cc: Stephane Grosjean <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> # 3.4 Reported-by: [email protected] Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Fixes: 46be265d3388 ("can: usb: PEAK-System Technik PCAN-USB specific part") Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> # 3.9 Cc: Bernd Krumboeck <[email protected]> Cc: Wolfgang Grandegger <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> # 4.12 Cc: Remigiusz Kołłątaj <[email protected]> Reported-by: [email protected] Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Navid Emamdoost <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Wen Yang <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Acked-by: Kalle Valo <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05Merge tag 'linux-can-next-for-5.4-20190904' of ↵David S. Miller4-8/+33
git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next 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 <[email protected]>
2019-09-04can: make use of preallocated can_ml_priv for per device struct ↵Marc Kleine-Budde4-0/+5
can_dev_rcv_lists 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 <[email protected]> Acked-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]>
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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2019-09-03can: kvaser_pciefd: the PWM generator is running at the bus frequency of the ↵Christer Beskow1-1/+5
system. 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 <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>