drivers: clock_control: remove inline attributes in stm32 clock drivers
Remove the inline attribute from stm32 clock drivers functions especially for functions that are only referenced in the clock API operation structure and therefore cannot be inline. As a generic comment, today compiler are smart enough to optimize embedded software without needing inline function attributes in the source files. This change hopes that next stm32 clock driver will no more replicate this bad habit when using existing source files as implementation examples. No functional change. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
This commit is contained in:
parent
dcf4855fa4
commit
04ffa4edd1
@ -247,8 +247,7 @@ int enabled_clock(uint32_t src_clk)
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
volatile int temp;
|
||||
@ -271,8 +270,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -289,9 +287,9 @@ static inline int stm32_clock_control_off(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
static int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
{
|
||||
/* At least one alt src clock available */
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -144,8 +144,7 @@ int enabled_clock(uint32_t src_clk)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
volatile int temp;
|
||||
@ -166,8 +165,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -184,9 +182,9 @@ static inline int stm32_clock_control_off(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
static int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
int err;
|
||||
|
||||
@ -382,8 +382,7 @@ int enabled_clock(uint32_t src_clk)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
volatile int temp;
|
||||
@ -409,8 +408,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -430,9 +428,9 @@ static inline int stm32_clock_control_off(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
static int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
int err;
|
||||
|
||||
@ -14,8 +14,7 @@
|
||||
/**
|
||||
* @brief fill in AHB/APB buses configuration structure
|
||||
*/
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -65,8 +64,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
|
||||
@ -191,8 +191,7 @@ static int enabled_clock(uint32_t src_clk)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -214,8 +213,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -237,9 +235,9 @@ static inline int stm32_clock_control_off(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
static int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
int err;
|
||||
|
||||
@ -150,8 +150,7 @@ int enabled_clock(uint32_t src_clk)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
volatile int temp;
|
||||
@ -172,8 +171,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -190,9 +188,9 @@ static inline int stm32_clock_control_off(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
static int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
int err;
|
||||
|
||||
@ -206,8 +206,7 @@ int enabled_clock(uint32_t src_clk)
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
const mem_addr_t reg = RCC_REG(pclken->bus);
|
||||
@ -230,8 +229,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
const mem_addr_t reg = RCC_REG(pclken->bus);
|
||||
@ -247,9 +245,9 @@ static inline int stm32_clock_control_off(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
static int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)sub_system;
|
||||
const uint32_t shift = STM32_DT_CLKSEL_SHIFT_GET(pclken->enr);
|
||||
@ -271,7 +269,7 @@ static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_apb0_periph_clkrate(struct stm32_pclken *pclken,
|
||||
static int get_apb0_periph_clkrate(struct stm32_pclken *pclken,
|
||||
uint32_t *rate, uint32_t slow_clock, uint32_t sysclk, uint32_t clk_sys)
|
||||
{
|
||||
switch (pclken->enr) {
|
||||
@ -312,8 +310,7 @@ static inline int get_apb0_periph_clkrate(struct stm32_pclken *pclken,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_apb1_periph_clkrate(struct stm32_pclken *pclken,
|
||||
uint32_t *rate, uint32_t clk_sys)
|
||||
static int get_apb1_periph_clkrate(struct stm32_pclken *pclken, uint32_t *rate, uint32_t clk_sys)
|
||||
{
|
||||
switch (pclken->enr) {
|
||||
#if defined(SPI1)
|
||||
@ -603,7 +600,7 @@ static void set_up_fixed_clock_sources(void)
|
||||
* @brief Converts the Kconfig STM32_WB0_CLKSYS_PRESCALER option
|
||||
* to a LL_RCC_RC64MPLL_DIV_x value understandable by the LL.
|
||||
*/
|
||||
static inline uint32_t kconfig_to_ll_prescaler(uint32_t kcfg_pre)
|
||||
static uint32_t kconfig_to_ll_prescaler(uint32_t kcfg_pre)
|
||||
{
|
||||
switch (kcfg_pre) {
|
||||
case 1:
|
||||
|
||||
@ -62,8 +62,7 @@ int enabled_clock(uint32_t src_clk)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_on(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
volatile int temp;
|
||||
@ -84,8 +83,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_off(const struct device *dev,
|
||||
clock_control_subsys_t sub_system)
|
||||
static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
|
||||
{
|
||||
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
|
||||
|
||||
@ -102,9 +100,9 @@ static inline int stm32_clock_control_off(const struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
static int stm32_clock_control_configure(const struct device *dev,
|
||||
clock_control_subsys_t sub_system,
|
||||
void *data)
|
||||
{
|
||||
#if defined(STM32_SRC_CLOCK_MIN)
|
||||
/* At least one alt src clock available */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user