Skip to content

Commit ebd33d3

Browse files
drivers: can: xmc4xxx: use proper namespace for Kconfig symbols
Use proper namespace for the CAN xmc4xxx Kconfig symbols, renaming CONFIG_CAN_MAX_FILTER to CONFIG_CAN_XMC4XXX_MAX_FILTER. This prevents Kconfig symbol clashes between different CAN controller drivers. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
1 parent 50e2104 commit ebd33d3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

drivers/can/Kconfig.xmc4xxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ config CAN_XMC4XXX_INTERNAL_BUS_MODE
3535
Connects all XMC4XXX CAN devices to an internal bus. Enables
3636
message exchange between MCU CAN devices without any external connectors.
3737

38-
config CAN_MAX_FILTER
38+
config CAN_XMC4XXX_MAX_FILTER
3939
int "Maximum number of concurrent active filters"
4040
default 4
4141
range 1 32

drivers/can/can_xmc4xxx.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ struct can_xmc4xxx_data {
6565
struct can_xmc4xxx_tx_callback tx_callbacks[CONFIG_CAN_XMC4XXX_MAX_TX_QUEUE];
6666

6767
uint32_t filter_usage;
68-
struct can_xmc4xxx_rx_callback rx_callbacks[CONFIG_CAN_MAX_FILTER];
69-
struct can_xmc4xxx_rx_fifo rx_fifos[CONFIG_CAN_MAX_FILTER];
68+
struct can_xmc4xxx_rx_callback rx_callbacks[CONFIG_CAN_XMC4XXX_MAX_FILTER];
69+
struct can_xmc4xxx_rx_fifo rx_fifos[CONFIG_CAN_XMC4XXX_MAX_FILTER];
7070
#if defined(CONFIG_CAN_ACCEPT_RTR)
71-
struct can_xmc4xxx_rx_fifo rtr_fifos[CONFIG_CAN_MAX_FILTER];
71+
struct can_xmc4xxx_rx_fifo rtr_fifos[CONFIG_CAN_XMC4XXX_MAX_FILTER];
7272
#endif
7373

7474
CAN_MO_TypeDef *tx_mo[CONFIG_CAN_XMC4XXX_MAX_TX_QUEUE];
@@ -362,13 +362,13 @@ static int can_xmc4xxx_add_rx_filter(const struct device *dev, can_rx_callback_t
362362

363363
k_mutex_lock(&dev_data->mutex, K_FOREVER);
364364

365-
for (filter_idx = 0; filter_idx < CONFIG_CAN_MAX_FILTER; filter_idx++) {
365+
for (filter_idx = 0; filter_idx < CONFIG_CAN_XMC4XXX_MAX_FILTER; filter_idx++) {
366366
if ((BIT(filter_idx) & dev_data->filter_usage) == 0) {
367367
break;
368368
}
369369
}
370370

371-
if (filter_idx >= CONFIG_CAN_MAX_FILTER) {
371+
if (filter_idx >= CONFIG_CAN_XMC4XXX_MAX_FILTER) {
372372
filter_idx = -ENOSPC;
373373
} else {
374374
unsigned int key = irq_lock();
@@ -408,7 +408,7 @@ static void can_xmc4xxx_remove_rx_filter(const struct device *dev, int filter_id
408408
struct can_xmc4xxx_data *dev_data = dev->data;
409409
unsigned int key;
410410

411-
if (filter_idx < 0 || filter_idx >= CONFIG_CAN_MAX_FILTER) {
411+
if (filter_idx < 0 || filter_idx >= CONFIG_CAN_XMC4XXX_MAX_FILTER) {
412412
LOG_ERR("Filter ID %d out of bounds", filter_idx);
413413
return;
414414
}
@@ -509,7 +509,7 @@ static int can_xmc4xxx_get_max_filters(const struct device *dev, bool ide)
509509
{
510510
ARG_UNUSED(ide);
511511

512-
return CONFIG_CAN_MAX_FILTER;
512+
return CONFIG_CAN_XMC4XXX_MAX_FILTER;
513513
}
514514

515515
static void can_xmc4xxx_reset_tx_fifos(const struct device *dev, int status)
@@ -640,7 +640,7 @@ static void can_xmc4xxx_rx_handler(const struct device *dev)
640640
{
641641
struct can_xmc4xxx_data *dev_data = dev->data;
642642

643-
for (int i = 0; i < CONFIG_CAN_MAX_FILTER; i++) {
643+
for (int i = 0; i < CONFIG_CAN_XMC4XXX_MAX_FILTER; i++) {
644644
if ((BIT(i) & dev_data->filter_usage) == 0) {
645645
continue;
646646
}

0 commit comments

Comments
 (0)