Skip to content

Commit

Permalink
fix(Other): Fix Wrap_MXC_CAN_Init signature
Browse files Browse the repository at this point in the history
The previous implementation declared Wrap_MXC_CAN_Init as void
and discarded the return value of the underlying MXC_CAN_Init
calls. This is incompatible with the can_max32 driver which
does eror checking and expects an int return value.

While this is a "breaking" change, no code depends on this
wrapper, because its signature is invalid.

Signed-off-by: Ioan Dragomir <ioan.dragomir@analog.com>
  • Loading branch information
trupples committed Jan 9, 2025
1 parent 8abf4d2 commit 361c593
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Libraries/zephyr/MAX/Include/wrap_max32_can.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2024 Analog Devices, Inc.
* Copyright (C) 2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,7 @@
extern "C" {
#endif

static inline void Wrap_MXC_CAN_Init(uint32_t can_idx, mxc_can_obj_cfg_t cfg,
static inline int Wrap_MXC_CAN_Init(uint32_t can_idx, mxc_can_obj_cfg_t cfg,
mxc_can_unit_event_cb_t unit_cb,
mxc_can_object_event_cb_t obj_cb)
{
Expand All @@ -40,11 +40,11 @@ static inline void Wrap_MXC_CAN_Init(uint32_t can_idx, mxc_can_obj_cfg_t cfg,
/* A value of -1 is invalid, will configure no GPIOs, but still pass through
* to MXC_CAN_RevA_Init, even in case MSDK_NO_GPIO_CLK_INIT wasn't set.
*/
MXC_CAN_Init(can_idx, cfg, unit_cb, obj_cb, -1);
return MXC_CAN_Init(can_idx, cfg, unit_cb, obj_cb, -1);

/* MAX32690 related mapping */
#elif defined(CONFIG_SOC_MAX32690)
MXC_CAN_Init(can_idx, cfg, unit_cb, obj_cb);
return MXC_CAN_Init(can_idx, cfg, unit_cb, obj_cb);

#endif // part number
}
Expand Down

0 comments on commit 361c593

Please sign in to comment.