Skip to content

Commit cb2dc6d

Browse files
hartkoppmarckleinebudde
authored andcommitted
can: Kconfig: select CAN driver infrastructure by default
The CAN bus support enabled with CONFIG_CAN provides a socket-based access to CAN interfaces. With the introduction of the latest CAN protocol CAN XL additional configuration status information needs to be exposed to the network layer than formerly provided by standard Linux network drivers. This requires the CAN driver infrastructure to be selected by default. As the CAN network layer can only operate on CAN interfaces anyway all distributions and common default configs enable at least one CAN driver. So selecting CONFIG_CAN_DEV when CONFIG_CAN is selected by the user has no effect on established configurations but solves potential build issues when CONFIG_CAN[_XXX]=y is set together with CANFIG_CAN_DEV=m Fixes: 1a620a7 ("can: raw: instantly reject unsupported CAN frames") Reported-by: Vincent Mailhol <mailhol@kernel.org> Closes: https://lore.kernel.org/all/CAMZ6RqL_nGszwoLPXn1Li8op-ox4k3Hs6p=Hw6+w0W=DTtobPw@mail.gmail.com/ Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202511280531.YnWW2Rxc-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202511280842.djCQ0N0O-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202511282325.uVQFRTkA-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202511291520.guIE1QHj-lkp@intel.com/ Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://patch.msgid.link/20251129090500.17484-1-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent ff736a2 commit cb2dc6d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

include/linux/can/dev.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@ struct net_device *alloc_candev_mqs(int sizeof_priv, unsigned int echo_skb_max,
111111
void free_candev(struct net_device *dev);
112112

113113
/* a candev safe wrapper around netdev_priv */
114+
#if IS_ENABLED(CONFIG_CAN_NETLINK)
114115
struct can_priv *safe_candev_priv(struct net_device *dev);
116+
#else
117+
static inline struct can_priv *safe_candev_priv(struct net_device *dev)
118+
{
119+
return NULL;
120+
}
121+
#endif
115122

116123
int open_candev(struct net_device *dev);
117124
void close_candev(struct net_device *dev);

net/can/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
menuconfig CAN
77
tristate "CAN bus subsystem support"
8+
select CAN_DEV
89
help
910
Controller Area Network (CAN) is a slow (up to 1Mbit/s) serial
1011
communications protocol. Development of the CAN bus started in

0 commit comments

Comments
 (0)