clock_control: Cleanup stm32f4x driver

This patch addresses the following issues:
* Aligns the Kconfig code style with Zephyr projects requirements.
* Removes redundant "depends on" from Kconfig.
* Adds static to the containing file scope declarations.

Change-Id: I14651826724c014cc71d62ab6cab03c668c578c0
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
This commit is contained in:
Vincenzo Frascino 2016-11-18 16:08:47 +00:00 committed by Anas Nashif
parent 9c1bb2b2b9
commit b6b35f6113
2 changed files with 4 additions and 6 deletions

View File

@ -21,7 +21,6 @@ if SOC_SERIES_STM32F4X
menuconfig CLOCK_CONTROL_STM32F4X
bool
prompt "STM32F4X Reset & Clock Control"
depends on CLOCK_CONTROL && SOC_SERIES_STM32F4X
default y if SOC_SERIES_STM32F4X
help
Enable driver for Reset & Clock Control subsystem found
@ -148,4 +147,3 @@ config CLOCK_STM32F4X_APB2_PRESCALER
0, 2, 4, 8, 16. The APB2 clock must not exceed 84MHz.
endif

View File

@ -104,7 +104,7 @@ struct regval_map {
int reg;
};
int map_reg_val(const struct regval_map *map, size_t cnt, int val)
static int map_reg_val(const struct regval_map *map, size_t cnt, int val)
{
for (int i = 0; i < cnt; i++) {
if (map[i].val == val) {
@ -180,7 +180,7 @@ static int __pllp_div(int div)
}
#endif /* CONFIG_CLOCK_STM32F4X_SYSCLK_SRC_PLL */
uint32_t __get_ahb_clock(uint32_t sysclk)
static uint32_t __get_ahb_clock(uint32_t sysclk)
{
/* AHB clock is generated based on SYSCLK */
uint32_t sysclk_div = CONFIG_CLOCK_STM32F4X_AHB_PRESCALER;
@ -192,7 +192,7 @@ uint32_t __get_ahb_clock(uint32_t sysclk)
return sysclk / sysclk_div;
}
uint32_t __get_apb_clock(uint32_t ahb_clock, uint32_t prescaler)
static uint32_t __get_apb_clock(uint32_t ahb_clock, uint32_t prescaler)
{
if (prescaler == 0) {
prescaler = 1;
@ -237,7 +237,7 @@ static struct clock_control_driver_api stm32f4x_clock_control_api = {
.get_rate = stm32f4x_clock_control_get_subsys_rate,
};
int stm32f4x_clock_control_init(struct device *dev)
static int stm32f4x_clock_control_init(struct device *dev)
{
struct stm32f4x_rcc_data *data = dev->driver_data;
volatile struct stm32f4x_rcc *rcc =