drivers: can: init timing.sjw also in canfd mode

This commit resolves the undefined behviour caused by missing timing.sjw
initialization.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
This commit is contained in:
Thomas Stranger 2021-05-08 09:46:19 +02:00 committed by Kumar Gala
commit 12c80eba71

View file

@ -343,11 +343,11 @@ int can_mcan_init(const struct device *dev, const struct can_mcan_config *cfg,
}
#endif
timing.sjw = cfg->sjw;
#ifdef CONFIG_CAN_FD_MODE
timing_data.sjw = cfg->sjw_data;
can_mcan_configure_timing(can, &timing, &timing_data);
#else
timing.sjw = cfg->sjw;
can_mcan_configure_timing(can, &timing, NULL);
#endif