Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: Kconfig: add CONFIG_CAN_RX_OFFLOAD

Only a few drivers rely on the CAN rx offload framework (as of the
writing of this patch, only four: flexcan, m_can, mcp251xfd and
ti_hecc). Split it out of can-dev and add a new config symbol:
CAN_RX_OFFLOAD.

The drivers relying on CAN rx offload are in different sub
folders. Make CAN_RX_OFFLOAD an hidden option and tag all the drivers
depending on that feature with "select CAN_RX_OFFLOAD" so that the
option gets automatically enabled if and only if one of those drivers
is chosen.

Link: https://lore.kernel.org/all/20220610143009.323579-5-mailhol.vincent@wanadoo.fr
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Acked-by: Max Staudt <max@enpas.org>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Vincent Mailhol and committed by
Marc Kleine-Budde
bfe0092d 0c7e1151

+8 -1
+5
drivers/net/can/Kconfig
··· 102 102 103 103 If unsure, say Y. 104 104 105 + config CAN_RX_OFFLOAD 106 + bool 107 + 105 108 config CAN_AT91 106 109 tristate "Atmel AT91 onchip CAN controller" 107 110 depends on (ARCH_AT91 || COMPILE_TEST) && HAS_IOMEM ··· 116 113 tristate "Support for Freescale FLEXCAN based chips" 117 114 depends on OF || COLDFIRE || COMPILE_TEST 118 115 depends on HAS_IOMEM 116 + select CAN_RX_OFFLOAD 119 117 help 120 118 Say Y here if you want to support for Freescale FlexCAN. 121 119 ··· 166 162 config CAN_TI_HECC 167 163 depends on ARM 168 164 tristate "TI High End CAN Controller" 165 + select CAN_RX_OFFLOAD 169 166 help 170 167 Driver for TI HECC (High End CAN Controller) module found on many 171 168 TI devices. The device specifications are available from www.ti.com
+1 -1
drivers/net/can/dev/Makefile
··· 9 9 can-dev-$(CONFIG_CAN_NETLINK) += dev.o 10 10 can-dev-$(CONFIG_CAN_NETLINK) += length.o 11 11 can-dev-$(CONFIG_CAN_NETLINK) += netlink.o 12 - can-dev-$(CONFIG_CAN_NETLINK) += rx-offload.o 12 + can-dev-$(CONFIG_CAN_RX_OFFLOAD) += rx-offload.o
+1
drivers/net/can/m_can/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 menuconfig CAN_M_CAN 3 3 tristate "Bosch M_CAN support" 4 + select CAN_RX_OFFLOAD 4 5 help 5 6 Say Y here if you want support for Bosch M_CAN controller framework. 6 7 This is common support for devices that embed the Bosch M_CAN IP.
+1
drivers/net/can/spi/mcp251xfd/Kconfig
··· 2 2 3 3 config CAN_MCP251XFD 4 4 tristate "Microchip MCP251xFD SPI CAN controllers" 5 + select CAN_RX_OFFLOAD 5 6 select REGMAP 6 7 select WANT_DEV_COREDUMP 7 8 help