drivers: can: add missing static keywords
Add missing static keywords for functions internal to the drivers. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
a6a07deb53
commit
99964fab45
9 changed files with 55 additions and 57 deletions
|
@ -63,7 +63,7 @@ static inline int check_filter_match(const struct zcan_frame *frame,
|
||||||
(frame->id & filter->id_mask));
|
(frame->id & filter->id_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tx_thread(void *arg1, void *arg2, void *arg3)
|
static void tx_thread(void *arg1, void *arg2, void *arg3)
|
||||||
{
|
{
|
||||||
const struct device *dev = arg1;
|
const struct device *dev = arg1;
|
||||||
struct can_loopback_data *data = dev->data;
|
struct can_loopback_data *data = dev->data;
|
||||||
|
@ -95,7 +95,7 @@ void tx_thread(void *arg1, void *arg2, void *arg3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_loopback_send(const struct device *dev,
|
static int can_loopback_send(const struct device *dev,
|
||||||
const struct zcan_frame *frame,
|
const struct zcan_frame *frame,
|
||||||
k_timeout_t timeout, can_tx_callback_t callback,
|
k_timeout_t timeout, can_tx_callback_t callback,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
|
@ -150,7 +150,7 @@ static inline int get_free_filter(struct can_loopback_filter *filters)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_loopback_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
static int can_loopback_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||||
void *cb_arg, const struct zcan_filter *filter)
|
void *cb_arg, const struct zcan_filter *filter)
|
||||||
{
|
{
|
||||||
struct can_loopback_data *data = dev->data;
|
struct can_loopback_data *data = dev->data;
|
||||||
|
@ -187,7 +187,7 @@ int can_loopback_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||||
return filter_id;
|
return filter_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void can_loopback_remove_rx_filter(const struct device *dev, int filter_id)
|
static void can_loopback_remove_rx_filter(const struct device *dev, int filter_id)
|
||||||
{
|
{
|
||||||
struct can_loopback_data *data = dev->data;
|
struct can_loopback_data *data = dev->data;
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ void can_loopback_remove_rx_filter(const struct device *dev, int filter_id)
|
||||||
k_mutex_unlock(&data->mtx);
|
k_mutex_unlock(&data->mtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_loopback_set_mode(const struct device *dev, enum can_mode mode)
|
static int can_loopback_set_mode(const struct device *dev, enum can_mode mode)
|
||||||
{
|
{
|
||||||
struct can_loopback_data *data = dev->data;
|
struct can_loopback_data *data = dev->data;
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ int can_loopback_set_mode(const struct device *dev, enum can_mode mode)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_loopback_set_timing(const struct device *dev,
|
static int can_loopback_set_timing(const struct device *dev,
|
||||||
const struct can_timing *timing,
|
const struct can_timing *timing,
|
||||||
const struct can_timing *timing_data)
|
const struct can_timing *timing_data)
|
||||||
{
|
{
|
||||||
|
@ -233,7 +233,7 @@ static int can_loopback_get_state(const struct device *dev, enum can_state *stat
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
||||||
int can_loopback_recover(const struct device *dev, k_timeout_t timeout)
|
static int can_loopback_recover(const struct device *dev, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(dev);
|
ARG_UNUSED(dev);
|
||||||
ARG_UNUSED(timeout);
|
ARG_UNUSED(timeout);
|
||||||
|
@ -251,14 +251,14 @@ static void can_loopback_set_state_change_callback(const struct device *dev,
|
||||||
ARG_UNUSED(user_data);
|
ARG_UNUSED(user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_loopback_get_core_clock(const struct device *dev, uint32_t *rate)
|
static int can_loopback_get_core_clock(const struct device *dev, uint32_t *rate)
|
||||||
{
|
{
|
||||||
/* Return 16MHz as an realistic value for the testcases */
|
/* Return 16MHz as an realistic value for the testcases */
|
||||||
*rate = 16000000;
|
*rate = 16000000;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_loopback_get_max_filters(const struct device *dev, enum can_ide id_type)
|
static int can_loopback_get_max_filters(const struct device *dev, enum can_ide id_type)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(id_type);
|
ARG_UNUSED(id_type);
|
||||||
|
|
||||||
|
|
|
@ -328,14 +328,14 @@ static int mcp2515_get_core_clock(const struct device *dev, uint32_t *rate)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mcp2515_get_max_filters(const struct device *dev, enum can_ide id_type)
|
static int mcp2515_get_max_filters(const struct device *dev, enum can_ide id_type)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(id_type);
|
ARG_UNUSED(id_type);
|
||||||
|
|
||||||
return CONFIG_CAN_MAX_FILTER;
|
return CONFIG_CAN_MAX_FILTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mcp2515_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int mcp2515_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct mcp2515_config *dev_cfg = dev->config;
|
const struct mcp2515_config *dev_cfg = dev->config;
|
||||||
|
|
||||||
|
|
|
@ -135,14 +135,14 @@ static int mcux_flexcan_get_core_clock(const struct device *dev, uint32_t *rate)
|
||||||
return clock_control_get_rate(config->clock_dev, config->clock_subsys, rate);
|
return clock_control_get_rate(config->clock_dev, config->clock_subsys, rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mcux_flexcan_get_max_filters(const struct device *dev, enum can_ide id_type)
|
static int mcux_flexcan_get_max_filters(const struct device *dev, enum can_ide id_type)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(id_type);
|
ARG_UNUSED(id_type);
|
||||||
|
|
||||||
return CONFIG_CAN_MAX_FILTER;
|
return CONFIG_CAN_MAX_FILTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mcux_flexcan_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int mcux_flexcan_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct mcux_flexcan_config *config = dev->config;
|
const struct mcux_flexcan_config *config = dev->config;
|
||||||
|
|
||||||
|
@ -450,7 +450,7 @@ static void mcux_flexcan_set_state_change_callback(const struct device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
||||||
int mcux_flexcan_recover(const struct device *dev, k_timeout_t timeout)
|
static int mcux_flexcan_recover(const struct device *dev, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
const struct mcux_flexcan_config *config = dev->config;
|
const struct mcux_flexcan_config *config = dev->config;
|
||||||
enum can_state state;
|
enum can_state state;
|
||||||
|
|
|
@ -99,7 +99,7 @@ static int mcux_mcan_get_core_clock(const struct device *dev, uint32_t *rate)
|
||||||
rate);
|
rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mcux_mcan_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int mcux_mcan_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct mcux_mcan_config *config = dev->config;
|
const struct mcux_mcan_config *config = dev->config;
|
||||||
|
|
||||||
|
|
|
@ -566,7 +566,7 @@ static int can_rcar_enter_operation_mode(const struct can_rcar_cfg *config)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_rcar_set_mode(const struct device *dev, enum can_mode mode)
|
static int can_rcar_set_mode(const struct device *dev, enum can_mode mode)
|
||||||
{
|
{
|
||||||
const struct can_rcar_cfg *config = dev->config;
|
const struct can_rcar_cfg *config = dev->config;
|
||||||
struct can_rcar_data *data = dev->data;
|
struct can_rcar_data *data = dev->data;
|
||||||
|
@ -647,7 +647,7 @@ static void can_rcar_set_bittiming(const struct can_rcar_cfg *config,
|
||||||
config->reg_addr + RCAR_CAN_BCR);
|
config->reg_addr + RCAR_CAN_BCR);
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_rcar_set_timing(const struct device *dev,
|
static int can_rcar_set_timing(const struct device *dev,
|
||||||
const struct can_timing *timing,
|
const struct can_timing *timing,
|
||||||
const struct can_timing *timing_data)
|
const struct can_timing *timing_data)
|
||||||
{
|
{
|
||||||
|
@ -703,7 +703,7 @@ static int can_rcar_get_state(const struct device *dev, enum can_state *state,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
||||||
int can_rcar_recover(const struct device *dev, k_timeout_t timeout)
|
static int can_rcar_recover(const struct device *dev, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
const struct can_rcar_cfg *config = dev->config;
|
const struct can_rcar_cfg *config = dev->config;
|
||||||
struct can_rcar_data *data = dev->data;
|
struct can_rcar_data *data = dev->data;
|
||||||
|
@ -738,7 +738,7 @@ done:
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */
|
#endif /* CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */
|
||||||
|
|
||||||
int can_rcar_send(const struct device *dev, const struct zcan_frame *frame,
|
static int can_rcar_send(const struct device *dev, const struct zcan_frame *frame,
|
||||||
k_timeout_t timeout, can_tx_callback_t callback,
|
k_timeout_t timeout, can_tx_callback_t callback,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
|
@ -839,7 +839,7 @@ static inline int can_rcar_add_rx_filter_unlocked(const struct device *dev,
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_rcar_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
static int can_rcar_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||||
void *cb_arg, const struct zcan_filter *filter)
|
void *cb_arg, const struct zcan_filter *filter)
|
||||||
{
|
{
|
||||||
struct can_rcar_data *data = dev->data;
|
struct can_rcar_data *data = dev->data;
|
||||||
|
@ -851,7 +851,7 @@ int can_rcar_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||||
return filter_id;
|
return filter_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void can_rcar_remove_rx_filter(const struct device *dev, int filter_id)
|
static void can_rcar_remove_rx_filter(const struct device *dev, int filter_id)
|
||||||
{
|
{
|
||||||
struct can_rcar_data *data = dev->data;
|
struct can_rcar_data *data = dev->data;
|
||||||
|
|
||||||
|
@ -1021,14 +1021,14 @@ static int can_rcar_get_core_clock(const struct device *dev, uint32_t *rate)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_rcar_get_max_filters(const struct device *dev, enum can_ide id_type)
|
static int can_rcar_get_max_filters(const struct device *dev, enum can_ide id_type)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(id_type);
|
ARG_UNUSED(id_type);
|
||||||
|
|
||||||
return CONFIG_CAN_RCAR_MAX_FILTER;
|
return CONFIG_CAN_RCAR_MAX_FILTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_rcar_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int can_rcar_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct can_rcar_cfg *config = dev->config;
|
const struct can_rcar_cfg *config = dev->config;
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ static int can_sam_set_timing(const struct device *dev, const struct can_timing
|
||||||
return can_mcan_set_timing(mcan_cfg, timing, timing_data);
|
return can_mcan_set_timing(mcan_cfg, timing, timing_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_sam_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int can_sam_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct can_sam_config *cfg = dev->config;
|
const struct can_sam_config *cfg = dev->config;
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,7 @@ static void can_stm32_get_msg_fifo(CAN_FIFOMailBox_TypeDef *mbox,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline void can_stm32_rx_isr_handler(const struct device *dev)
|
||||||
void can_stm32_rx_isr_handler(const struct device *dev)
|
|
||||||
{
|
{
|
||||||
struct can_stm32_data *data = dev->data;
|
struct can_stm32_data *data = dev->data;
|
||||||
const struct can_stm32_config *cfg = dev->config;
|
const struct can_stm32_config *cfg = dev->config;
|
||||||
|
@ -200,8 +199,7 @@ static inline void can_stm32_bus_state_change_isr(const struct device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline void can_stm32_tx_isr_handler(const struct device *dev)
|
||||||
void can_stm32_tx_isr_handler(const struct device *dev)
|
|
||||||
{
|
{
|
||||||
struct can_stm32_data *data = dev->data;
|
struct can_stm32_data *data = dev->data;
|
||||||
const struct can_stm32_config *cfg = dev->config;
|
const struct can_stm32_config *cfg = dev->config;
|
||||||
|
@ -343,7 +341,7 @@ static int can_leave_sleep_mode(CAN_TypeDef *can)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32_set_mode(const struct device *dev, enum can_mode mode)
|
static int can_stm32_set_mode(const struct device *dev, enum can_mode mode)
|
||||||
{
|
{
|
||||||
const struct can_stm32_config *cfg = dev->config;
|
const struct can_stm32_config *cfg = dev->config;
|
||||||
CAN_TypeDef *can = cfg->can;
|
CAN_TypeDef *can = cfg->can;
|
||||||
|
@ -403,7 +401,7 @@ done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32_set_timing(const struct device *dev,
|
static int can_stm32_set_timing(const struct device *dev,
|
||||||
const struct can_timing *timing,
|
const struct can_timing *timing,
|
||||||
const struct can_timing *timing_data)
|
const struct can_timing *timing_data)
|
||||||
{
|
{
|
||||||
|
@ -443,7 +441,7 @@ done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32_get_core_clock(const struct device *dev, uint32_t *rate)
|
static int can_stm32_get_core_clock(const struct device *dev, uint32_t *rate)
|
||||||
{
|
{
|
||||||
const struct can_stm32_config *cfg = dev->config;
|
const struct can_stm32_config *cfg = dev->config;
|
||||||
const struct device *clock;
|
const struct device *clock;
|
||||||
|
@ -462,14 +460,14 @@ int can_stm32_get_core_clock(const struct device *dev, uint32_t *rate)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32_get_max_filters(const struct device *dev, enum can_ide id_type)
|
static int can_stm32_get_max_filters(const struct device *dev, enum can_ide id_type)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(id_type);
|
ARG_UNUSED(id_type);
|
||||||
|
|
||||||
return CONFIG_CAN_MAX_FILTER;
|
return CONFIG_CAN_MAX_FILTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int can_stm32_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct can_stm32_config *config = dev->config;
|
const struct can_stm32_config *config = dev->config;
|
||||||
|
|
||||||
|
@ -612,7 +610,7 @@ static void can_stm32_set_state_change_callback(const struct device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
||||||
int can_stm32_recover(const struct device *dev, k_timeout_t timeout)
|
static int can_stm32_recover(const struct device *dev, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
const struct can_stm32_config *cfg = dev->config;
|
const struct can_stm32_config *cfg = dev->config;
|
||||||
struct can_stm32_data *data = dev->data;
|
struct can_stm32_data *data = dev->data;
|
||||||
|
@ -653,7 +651,7 @@ done:
|
||||||
#endif /* CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */
|
#endif /* CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */
|
||||||
|
|
||||||
|
|
||||||
int can_stm32_send(const struct device *dev, const struct zcan_frame *frame,
|
static int can_stm32_send(const struct device *dev, const struct zcan_frame *frame,
|
||||||
k_timeout_t timeout, can_tx_callback_t callback,
|
k_timeout_t timeout, can_tx_callback_t callback,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
|
@ -801,7 +799,7 @@ static int can_stm32_shift_arr(void **arr, int start, int count)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum can_filter_type can_stm32_get_filter_type(int bank_nr, uint32_t mode_reg,
|
static enum can_filter_type can_stm32_get_filter_type(int bank_nr, uint32_t mode_reg,
|
||||||
uint32_t scale_reg)
|
uint32_t scale_reg)
|
||||||
{
|
{
|
||||||
uint32_t mode_masked = (mode_reg >> bank_nr) & 0x01;
|
uint32_t mode_masked = (mode_reg >> bank_nr) & 0x01;
|
||||||
|
@ -1082,7 +1080,7 @@ static inline int can_stm32_add_rx_filter_unlocked(const struct device *dev,
|
||||||
return filter_id;
|
return filter_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
static int can_stm32_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||||
void *cb_arg,
|
void *cb_arg,
|
||||||
const struct zcan_filter *filter)
|
const struct zcan_filter *filter)
|
||||||
{
|
{
|
||||||
|
@ -1096,7 +1094,7 @@ int can_stm32_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||||
return filter_id;
|
return filter_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void can_stm32_remove_rx_filter(const struct device *dev, int filter_id)
|
static void can_stm32_remove_rx_filter(const struct device *dev, int filter_id)
|
||||||
{
|
{
|
||||||
const struct can_stm32_config *cfg = dev->config;
|
const struct can_stm32_config *cfg = dev->config;
|
||||||
struct can_stm32_data *data = dev->data;
|
struct can_stm32_data *data = dev->data;
|
||||||
|
|
|
@ -145,7 +145,7 @@ static int can_stm32fd_set_timing(const struct device *dev,
|
||||||
return can_mcan_set_timing(mcan_cfg, timing, timing_data);
|
return can_mcan_set_timing(mcan_cfg, timing, timing_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32fd_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int can_stm32fd_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct can_stm32fd_config *cfg = dev->config;
|
const struct can_stm32fd_config *cfg = dev->config;
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ static int can_stm32h7_set_timing(const struct device *dev,
|
||||||
return can_mcan_set_timing(&cfg->mcan_cfg, timing, timing_data);
|
return can_mcan_set_timing(&cfg->mcan_cfg, timing, timing_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int can_stm32h7_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
static int can_stm32h7_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
const struct can_stm32h7_config *cfg = dev->config;
|
const struct can_stm32h7_config *cfg = dev->config;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue