soc: stm32: convert to use DEVICE_DT_GET for clocks
Convert from device_get_binding to DEVICE_DT_GET. In doing this we no longer need the label in the devicetree node so we remove that. Removed all __ASSERT_NO_MSG(clk) since we'll get a build error if DEVICE_DT_GET cant be satisfied, and the clock control api's will handle reporting if the device_is_ready. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
ca5272f239
commit
b275fec8c4
40 changed files with 44 additions and 89 deletions
|
@ -309,7 +309,7 @@ static int gpio_stm32_enable_int(int port, int pin)
|
|||
defined(CONFIG_SOC_SERIES_STM32L1X) || \
|
||||
defined(CONFIG_SOC_SERIES_STM32L4X) || \
|
||||
defined(CONFIG_SOC_SERIES_STM32G4X)
|
||||
const struct device *clk = device_get_binding(STM32_CLOCK_CONTROL_NAME);
|
||||
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
|
||||
struct stm32_pclken pclken = {
|
||||
#ifdef CONFIG_SOC_SERIES_STM32H7X
|
||||
.bus = STM32_CLOCK_BUS_APB4,
|
||||
|
@ -531,8 +531,7 @@ static int gpio_stm32_init(const struct device *device)
|
|||
data->dev = device;
|
||||
|
||||
/* enable clock for subsystem */
|
||||
const struct device *clk =
|
||||
device_get_binding(STM32_CLOCK_CONTROL_NAME);
|
||||
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
|
||||
|
||||
if (clock_control_on(clk,
|
||||
(clock_control_subsys_t *)&cfg->pclken) != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue