drivers: can: Set a initial state to the can device before HAL_CAN_Init
As part of HAL_CAN_Init we check the initial state of the can handle. Setting it to HAL_CAN_STATE_RESET as an initial state to start the Init properly. Resolves: #8416 Coverity-CID: 186580 Signed-off-by: Sritej Kanakadandi Venkata Rama <sritej.kvr@gmail.com>
This commit is contained in:
parent
e6a746ea6f
commit
6f61f09803
1 changed files with 2 additions and 0 deletions
|
@ -254,6 +254,8 @@ int can_stm32_runtime_configure(struct device *dev, enum can_mode mode,
|
|||
hcan.Init.BS2 = bs2;
|
||||
hcan.Init.Prescaler = prescaler;
|
||||
|
||||
hcan.State = HAL_CAN_STATE_RESET;
|
||||
|
||||
hal_ret = HAL_CAN_Init(&hcan);
|
||||
if (hal_ret != HAL_OK) {
|
||||
SYS_LOG_ERR("HAL_CAN_Init failed: %d", hal_ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue