linux-sg2042/drivers/net/can/m_can
Vincent Mailhol 7d4a101c0b can: dev: add sanity check in can_set_static_ctrlmode()
Previous patch removed can_priv::ctrlmode_static to replace it with
can_get_static_ctrlmode().

A condition sine qua non for this to work is that the controller
static modes should never be set in can_priv::ctrlmode_supported
(c.f. the comment on can_priv::ctrlmode_supported which states that it
is for "options that can be *modified* by netlink"). Also, this
condition is already correctly fulfilled by all existing drivers
which rely on the ctrlmode_static feature.

Nonetheless, we added an extra safeguard in can_set_static_ctrlmode()
to return an error value and to warn the developer who would be
adventurous enough to set to static a given feature that is already
set to supported.

The drivers which rely on the static controller mode are then updated
to check the return value of can_set_static_ctrlmode().

Link: https://lore.kernel.org/all/20211213160226.56219-3-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-01-05 12:09:05 +01:00
..
Kconfig can: m_can: add PCI glue driver for Intel Elkhart Lake 2020-12-10 10:40:10 +01:00
Makefile can: tcan4x5x: move regmap code into seperate file 2021-01-06 15:15:37 +01:00
m_can.c can: dev: add sanity check in can_set_static_ctrlmode() 2022-01-05 12:09:05 +01:00
m_can.h can: m_can: make custom bittiming fields const 2021-12-07 09:51:41 +01:00
m_can_pci.c can: m_can: pci: use custom bit timings for Elkhart Lake 2021-12-07 09:51:41 +01:00
m_can_platform.c can: m_can: fix iomap_read_fifo() and iomap_write_fifo() 2021-10-17 22:51:43 +02:00
tcan4x5x-core.c can: m_can: Disable IRQs on FIFO bus errors 2021-08-19 15:07:04 +02:00
tcan4x5x-regmap.c can: tcan4x5x: add support for half-duplex controllers 2021-01-06 15:15:41 +01:00
tcan4x5x.h can: tcan4x5x: remove duplicate include of regmap.h 2021-03-30 11:14:48 +02:00