Browse Source

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>
pull/87372/head
Etienne Carriere 4 months ago committed by Anas Nashif
parent
commit
04ffa4edd1
  1. 12
      drivers/clock_control/clock_stm32_ll_common.c
  2. 12
      drivers/clock_control/clock_stm32_ll_h5.c
  3. 12
      drivers/clock_control/clock_stm32_ll_h7.c
  4. 6
      drivers/clock_control/clock_stm32_ll_mp1.c
  5. 12
      drivers/clock_control/clock_stm32_ll_n6.c
  6. 12
      drivers/clock_control/clock_stm32_ll_u5.c
  7. 19
      drivers/clock_control/clock_stm32_ll_wb0.c
  8. 12
      drivers/clock_control/clock_stm32_ll_wba.c

12
drivers/clock_control/clock_stm32_ll_common.c

@ -247,8 +247,7 @@ int enabled_clock(uint32_t src_clk)
return r; return r;
} }
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
volatile int temp; volatile int temp;
@ -271,8 +270,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
return 0; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_configure(const struct device *dev, static int stm32_clock_control_configure(const struct device *dev,
clock_control_subsys_t sub_system, clock_control_subsys_t sub_system,
void *data) void *data)
{ {
/* At least one alt src clock available */ /* At least one alt src clock available */
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);

12
drivers/clock_control/clock_stm32_ll_h5.c

@ -144,8 +144,7 @@ int enabled_clock(uint32_t src_clk)
return -ENOTSUP; return -ENOTSUP;
} }
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
volatile int temp; volatile int temp;
@ -166,8 +165,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
return 0; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_configure(const struct device *dev, static int stm32_clock_control_configure(const struct device *dev,
clock_control_subsys_t sub_system, clock_control_subsys_t sub_system,
void *data) void *data)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
int err; int err;

12
drivers/clock_control/clock_stm32_ll_h7.c

@ -382,8 +382,7 @@ int enabled_clock(uint32_t src_clk)
return -ENOTSUP; return -ENOTSUP;
} }
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
volatile int temp; volatile int temp;
@ -409,8 +408,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
return 0; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_configure(const struct device *dev, static int stm32_clock_control_configure(const struct device *dev,
clock_control_subsys_t sub_system, clock_control_subsys_t sub_system,
void *data) void *data)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
int err; int err;

6
drivers/clock_control/clock_stm32_ll_mp1.c

@ -14,8 +14,7 @@
/** /**
* @brief fill in AHB/APB buses configuration structure * @brief fill in AHB/APB buses configuration structure
*/ */
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);

12
drivers/clock_control/clock_stm32_ll_n6.c

@ -191,8 +191,7 @@ static int enabled_clock(uint32_t src_clk)
return -ENOTSUP; return -ENOTSUP;
} }
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_configure(const struct device *dev, static int stm32_clock_control_configure(const struct device *dev,
clock_control_subsys_t sub_system, clock_control_subsys_t sub_system,
void *data) void *data)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
int err; int err;

12
drivers/clock_control/clock_stm32_ll_u5.c

@ -150,8 +150,7 @@ int enabled_clock(uint32_t src_clk)
return -ENOTSUP; return -ENOTSUP;
} }
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
volatile int temp; volatile int temp;
@ -172,8 +171,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
return 0; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_configure(const struct device *dev, static int stm32_clock_control_configure(const struct device *dev,
clock_control_subsys_t sub_system, clock_control_subsys_t sub_system,
void *data) void *data)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
int err; int err;

19
drivers/clock_control/clock_stm32_ll_wb0.c

@ -206,8 +206,7 @@ int enabled_clock(uint32_t src_clk)
return r; return r;
} }
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
const mem_addr_t reg = RCC_REG(pclken->bus); 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; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
const mem_addr_t reg = RCC_REG(pclken->bus); 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; return 0;
} }
static inline int stm32_clock_control_configure(const struct device *dev, static int stm32_clock_control_configure(const struct device *dev,
clock_control_subsys_t sub_system, clock_control_subsys_t sub_system,
void *data) void *data)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)sub_system; struct stm32_pclken *pclken = (struct stm32_pclken *)sub_system;
const uint32_t shift = STM32_DT_CLKSEL_SHIFT_GET(pclken->enr); 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; 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) uint32_t *rate, uint32_t slow_clock, uint32_t sysclk, uint32_t clk_sys)
{ {
switch (pclken->enr) { switch (pclken->enr) {
@ -312,8 +310,7 @@ static inline int get_apb0_periph_clkrate(struct stm32_pclken *pclken,
return 0; return 0;
} }
static inline int get_apb1_periph_clkrate(struct stm32_pclken *pclken, static int get_apb1_periph_clkrate(struct stm32_pclken *pclken, uint32_t *rate, uint32_t clk_sys)
uint32_t *rate, uint32_t clk_sys)
{ {
switch (pclken->enr) { switch (pclken->enr) {
#if defined(SPI1) #if defined(SPI1)
@ -603,7 +600,7 @@ static void set_up_fixed_clock_sources(void)
* @brief Converts the Kconfig STM32_WB0_CLKSYS_PRESCALER option * @brief Converts the Kconfig STM32_WB0_CLKSYS_PRESCALER option
* to a LL_RCC_RC64MPLL_DIV_x value understandable by the LL. * 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) { switch (kcfg_pre) {
case 1: case 1:

12
drivers/clock_control/clock_stm32_ll_wba.c

@ -62,8 +62,7 @@ int enabled_clock(uint32_t src_clk)
return -ENOTSUP; return -ENOTSUP;
} }
static inline int stm32_clock_control_on(const struct device *dev, static int stm32_clock_control_on(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system); struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
volatile int temp; volatile int temp;
@ -84,8 +83,7 @@ static inline int stm32_clock_control_on(const struct device *dev,
return 0; return 0;
} }
static inline int stm32_clock_control_off(const struct device *dev, static int stm32_clock_control_off(const struct device *dev, clock_control_subsys_t sub_system)
clock_control_subsys_t sub_system)
{ {
struct stm32_pclken *pclken = (struct stm32_pclken *)(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; return 0;
} }
static inline int stm32_clock_control_configure(const struct device *dev, static int stm32_clock_control_configure(const struct device *dev,
clock_control_subsys_t sub_system, clock_control_subsys_t sub_system,
void *data) void *data)
{ {
#if defined(STM32_SRC_CLOCK_MIN) #if defined(STM32_SRC_CLOCK_MIN)
/* At least one alt src clock available */ /* At least one alt src clock available */

Loading…
Cancel
Save