drivers: can: remove CAN_BUS_UNKNOWN CAN controller state
The CAN_BUS_UNKNOWN CAN controller state is only used to indicate that the current CAN controller state could not be read. Remove it and change the signature of the can_get_state() API function to return an integer indicating success or failure. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
b2190fd703
commit
2aed5a1237
15 changed files with 155 additions and 114 deletions
|
@ -90,13 +90,13 @@ static int can_stm32fd_init(const struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static enum can_state can_stm32fd_get_state(const struct device *dev,
|
||||
struct can_bus_err_cnt *err_cnt)
|
||||
static int can_stm32fd_get_state(const struct device *dev, enum can_state *state,
|
||||
struct can_bus_err_cnt *err_cnt)
|
||||
{
|
||||
const struct can_stm32fd_config *cfg = dev->config;
|
||||
const struct can_mcan_config *mcan_cfg = &cfg->mcan_cfg;
|
||||
|
||||
return can_mcan_get_state(mcan_cfg, err_cnt);
|
||||
return can_mcan_get_state(mcan_cfg, state, err_cnt);
|
||||
}
|
||||
|
||||
static int can_stm32fd_send(const struct device *dev, const struct zcan_frame *frame,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue