Skip to content

Commit bd0e0f2

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

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/can/Kconfig.mcp251xfd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ config CAN_MCP251XFD_READ_CRC_RETRIES
5151
help
5252
Number of retries during SFR register read if CRC fails.
5353

54-
config CAN_MAX_FILTER
54+
config CAN_MCP251XFD_MAX_FILTER
5555
int "Maximum number of concurrent active filters"
5656
default 5
5757
range 1 32

drivers/can/can_mcp251xfd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,13 +556,13 @@ static int mcp251xfd_add_rx_filter(const struct device *dev, can_rx_callback_t r
556556

557557
k_mutex_lock(&dev_data->mutex, K_FOREVER);
558558

559-
for (filter_idx = 0; filter_idx < CONFIG_CAN_MAX_FILTER ; filter_idx++) {
559+
for (filter_idx = 0; filter_idx < CONFIG_CAN_MCP251XFD_MAX_FILTER ; filter_idx++) {
560560
if ((BIT(filter_idx) & dev_data->filter_usage) == 0) {
561561
break;
562562
}
563563
}
564564

565-
if (filter_idx >= CONFIG_CAN_MAX_FILTER) {
565+
if (filter_idx >= CONFIG_CAN_MCP251XFD_MAX_FILTER) {
566566
filter_idx = -ENOSPC;
567567
goto done;
568568
}
@@ -629,7 +629,7 @@ static void mcp251xfd_remove_rx_filter(const struct device *dev, int filter_idx)
629629
uint32_t *reg;
630630
int ret;
631631

632-
if (filter_idx < 0 || filter_idx >= CONFIG_CAN_MAX_FILTER) {
632+
if (filter_idx < 0 || filter_idx >= CONFIG_CAN_MCP251XFD_MAX_FILTER) {
633633
LOG_ERR("Filter ID %d out of bounds", filter_idx);
634634
return;
635635
}
@@ -731,7 +731,7 @@ static int mcp251xfd_get_max_filters(const struct device *dev, bool ide)
731731
{
732732
ARG_UNUSED(ide);
733733

734-
return CONFIG_CAN_MAX_FILTER;
734+
return CONFIG_CAN_MCP251XFD_MAX_FILTER;
735735
}
736736

737737
static int mcp251xfd_handle_fifo_read(const struct device *dev, const struct mcp251xfd_fifo *fifo,

drivers/can/can_mcp251xfd.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,9 @@ struct mcp251xfd_data {
499499

500500
/* Filter Data */
501501
uint32_t filter_usage;
502-
struct can_filter filter[CONFIG_CAN_MAX_FILTER];
503-
can_rx_callback_t rx_cb[CONFIG_CAN_MAX_FILTER];
504-
void *cb_arg[CONFIG_CAN_MAX_FILTER];
502+
struct can_filter filter[CONFIG_CAN_MCP251XFD_MAX_FILTER];
503+
can_rx_callback_t rx_cb[CONFIG_CAN_MCP251XFD_MAX_FILTER];
504+
void *cb_arg[CONFIG_CAN_MCP251XFD_MAX_FILTER];
505505

506506
const struct device *dev;
507507

0 commit comments

Comments
 (0)