Commit 05318b53 authored by Henrik Brix Andersen's avatar Henrik Brix Andersen Committed by Christopher Friedt
Browse files

drivers: can: fix can_configure() when CAN-FD is enabled


Currently, can_configure() pass a hard-coded 0 for the data bitrate
(which is only used for CAN-FD), breaking this API for CAN-FD enabled
applications.

Instead pass in the provided bitrate for both arbitration phase and data
phase.

Fixes: #34375
Signed-off-by: default avatarHenrik Brix Andersen <hebad@vestas.com>
Showing with 1 addition and 2 deletions
+1 -2
......@@ -817,7 +817,7 @@ static inline int can_configure(const struct device *dev, enum can_mode mode,
uint32_t bitrate)
{
if (bitrate > 0) {
int err = can_set_bitrate(dev, bitrate, 0);
int err = can_set_bitrate(dev, bitrate, bitrate);
if (err != 0) {
return err;
}
......@@ -826,7 +826,6 @@ static inline int can_configure(const struct device *dev, enum can_mode mode,
return can_set_mode(dev, mode);
}
/**
* @brief Get current state
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment