drivers: clock_control: stm32: Convert drivers to new DT device macros

Convert clock_control drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE

As part of this we also changed STM32_CLOCK_CONTROL_NAME to be based on
devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-12-15 12:32:21 -06:00 committed by Maureen Helm
parent 57a402cd0a
commit 20689c17d4
4 changed files with 7 additions and 4 deletions

View file

@ -568,8 +568,9 @@ static int stm32_clock_control_init(const struct device *dev)
* @brief RCC device, note that priority is intentionally set to 1 so * @brief RCC device, note that priority is intentionally set to 1 so
* that the device init runs just after SOC init * that the device init runs just after SOC init
*/ */
DEVICE_AND_API_INIT(rcc_stm32, STM32_CLOCK_CONTROL_NAME, DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init, &stm32_clock_control_init,
device_pm_control_nop,
NULL, NULL, NULL, NULL,
PRE_KERNEL_1, PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY, CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY,

View file

@ -682,8 +682,9 @@ static int stm32_clock_control_init(const struct device *dev)
* @brief RCC device, note that priority is intentionally set to 1 so * @brief RCC device, note that priority is intentionally set to 1 so
* that the device init runs just after SOC init * that the device init runs just after SOC init
*/ */
DEVICE_AND_API_INIT(rcc_stm32, STM32_CLOCK_CONTROL_NAME, DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init, &stm32_clock_control_init,
device_pm_control_nop,
NULL, NULL, NULL, NULL,
PRE_KERNEL_1, PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY, CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY,

View file

@ -411,8 +411,9 @@ static int stm32_clock_control_init(const struct device *dev)
* @brief RCC device, note that priority is intentionally set to 1 so * @brief RCC device, note that priority is intentionally set to 1 so
* that the device init runs just after SOC init * that the device init runs just after SOC init
*/ */
DEVICE_AND_API_INIT(rcc_stm32, STM32_CLOCK_CONTROL_NAME, DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init, &stm32_clock_control_init,
device_pm_control_nop,
NULL, NULL, NULL, NULL,
PRE_KERNEL_1, PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY, CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY,

View file

@ -13,7 +13,7 @@
#include <dt-bindings/clock/stm32_clock.h> #include <dt-bindings/clock/stm32_clock.h>
/* common clock control device name for all STM32 chips */ /* common clock control device name for all STM32 chips */
#define STM32_CLOCK_CONTROL_NAME "stm32-cc" #define STM32_CLOCK_CONTROL_NAME DT_LABEL(DT_NODELABEL(rcc))
struct stm32_pclken { struct stm32_pclken {
uint32_t bus; uint32_t bus;