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:
Henrik Brix Andersen 2022-01-19 10:21:01 +01:00 committed by Carles Cufí
commit 2aed5a1237
15 changed files with 155 additions and 114 deletions

View file

@ -72,12 +72,12 @@ static void mcux_mcan_remove_rx_filter(const struct device *dev, int filter_id)
can_mcan_remove_rx_filter(&data->mcan, &data->msg_ram, filter_id);
}
static enum can_state mcux_mcan_get_state(const struct device *dev,
struct can_bus_err_cnt *err_cnt)
static int mcux_mcan_get_state(const struct device *dev, enum can_state *state,
struct can_bus_err_cnt *err_cnt)
{
const struct mcux_mcan_config *config = dev->config;
return can_mcan_get_state(&config->mcan, err_cnt);
return can_mcan_get_state(&config->mcan, state, err_cnt);
}
static void mcux_mcan_set_state_change_callback(const struct device *dev,