drivers/can: move CAN utils to CAN common files

Move can_bytes2dlc() and can_dlc2bytes() to a common CAN file
that can be shared between socketCAN implementation and CAN
character driver.

This is the first step to simplifying the logic repeated in
many CAN drivers.

Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
raiden00pl
2025-05-14 12:31:08 +02:00
committed by Alan C. Assis
parent 6d9971296b
commit 5d95d0871f
9 changed files with 260 additions and 159 deletions
+5 -1
View File
@@ -22,8 +22,12 @@
set(SRCS)
if(CONFIG_CAN OR CONFIG_NET_CAN)
list(APPEND SRCS can_common.c)
endif()
if(CONFIG_CAN)
set(SRCS can.c can_sender.c)
list(APPEND SRCS can.c can_sender.c)
endif()
if(CONFIG_CAN_MCP2515)