From d4be753df8f774c838a0e3d6e94dfde565354b08 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Mon, 9 Nov 2020 09:04:55 +0100 Subject: [PATCH] cpu/native: remove unused can_linux module b4f29035ce6ee12949df1227ee463340ea8e8571 adapted the can_linux module to the periph_can interface. This is a cleanup of some things that stayed behind. Here the makefile is removed, the references to can_linux in the dependency resolution and configuration Makefile are changed to the standard periph_can, and the startup code is adapted. --- boards/native/Makefile.dep | 1 - cpu/native/Makefile | 3 --- cpu/native/Makefile.include | 2 +- cpu/native/can/Makefile | 3 --- cpu/native/periph/can.c | 3 ++- cpu/native/startup.c | 10 +++++----- 6 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 cpu/native/can/Makefile diff --git a/boards/native/Makefile.dep b/boards/native/Makefile.dep index a25150b31a25..e1f2fac5a9d6 100644 --- a/boards/native/Makefile.dep +++ b/boards/native/Makefile.dep @@ -8,7 +8,6 @@ endif ifneq (,$(filter periph_can,$(FEATURES_USED))) ifeq ($(OS),Linux) - USEMODULE += can_linux CFLAGS += -DCAN_DLL_NUMOF=2 endif endif diff --git a/cpu/native/Makefile b/cpu/native/Makefile index f5ebcab7882b..552c3f8b255e 100644 --- a/cpu/native/Makefile +++ b/cpu/native/Makefile @@ -26,9 +26,6 @@ ifneq (,$(filter mtd_native,$(USEMODULE))) DIRS += mtd endif -ifneq (,$(filter can_linux,$(USEMODULE))) - DIRS += can -endif ifneq (,$(filter backtrace,$(USEMODULE))) DIRS += backtrace endif diff --git a/cpu/native/Makefile.include b/cpu/native/Makefile.include index a61d7d7c5eb4..0dbbe715fbb6 100644 --- a/cpu/native/Makefile.include +++ b/cpu/native/Makefile.include @@ -5,7 +5,7 @@ ifeq ($(BUILDOSXNATIVE),1) NATIVEINCLUDES += -I$(RIOTCPU)/native/osx-libc-extra endif -ifneq (,$(filter can_linux,$(USEMODULE))) +ifneq (,$(filter periph_can,$(USEMODULE))) LINKFLAGS += -lsocketcan endif diff --git a/cpu/native/can/Makefile b/cpu/native/can/Makefile deleted file mode 100644 index db78e101ab0c..000000000000 --- a/cpu/native/can/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MODULE = can_linux - -include $(RIOTBASE)/Makefile.base diff --git a/cpu/native/periph/can.c b/cpu/native/periph/can.c index 5a18f21ab234..78ce8ddf9605 100644 --- a/cpu/native/periph/can.c +++ b/cpu/native/periph/can.c @@ -20,7 +20,8 @@ */ #if !defined(__linux__) -#error "MODULE can_linux is only available on Linux" +#error "Usage of periph_can on RIOT native requires libsocketcan. Currently \ + this is only available on Linux" #else #include diff --git a/cpu/native/startup.c b/cpu/native/startup.c index 3561426c71db..522a8195a683 100644 --- a/cpu/native/startup.c +++ b/cpu/native/startup.c @@ -75,7 +75,7 @@ netdev_tap_params_t netdev_tap_params[NETDEV_TAP_MAX]; #include "board.h" #include "mtd_native.h" #endif -#ifdef MODULE_CAN_LINUX +#ifdef MODULE_PERIPH_CAN #include "candev_linux.h" #endif #ifdef MODULE_PERIPH_SPIDEV_LINUX @@ -101,7 +101,7 @@ static const char short_opts[] = ":hi:s:deEoc:" #ifdef MODULE_MTD_NATIVE "m:" #endif -#ifdef MODULE_CAN_LINUX +#ifdef MODULE_PERIPH_CAN "n:" #endif #ifdef MODULE_SOCKET_ZEP @@ -127,7 +127,7 @@ static const struct option long_opts[] = { #ifdef MODULE_MTD_NATIVE { "mtd", required_argument, NULL, 'm' }, #endif -#ifdef MODULE_CAN_LINUX +#ifdef MODULE_PERIPH_CAN { "can", required_argument, NULL, 'n' }, #endif #ifdef MODULE_SOCKET_ZEP @@ -327,7 +327,7 @@ void usage_exit(int status) " -m , --mtd=\n" " specify the file name of mtd emulated device\n"); #endif -#if defined(MODULE_CAN_LINUX) +#if defined(MODULE_PERIPH_CAN) real_printf( " -n :, --can :\n" " specify CAN interface to use for CAN device #\n" @@ -504,7 +504,7 @@ __attribute__((constructor)) static void startup(int argc, char **argv, char **e ((mtd_native_dev_t *)mtd0)->fname = strndup(optarg, PATH_MAX - 1); break; #endif -#if defined(MODULE_CAN_LINUX) +#if defined(MODULE_PERIPH_CAN) case 'n':{ int i; i = atol(optarg);