Commit 5e97d779 authored by Kumar Gala's avatar Kumar Gala Committed by Kumar Gala
Browse files

device: convert DEVICE_INIT to DEVICE_DEFINE or SYS_DEVICE_DEFINE



Convert handful of users of DEVICE_INIT to DEVICE_DEFINE or
SYS_DEVICE_DEFINE to allow deprecation of DEVICE_INIT.

Signed-off-by: default avatarKumar Gala <kumar.gala@linaro.org>
parent d4394788
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -52,8 +52,10 @@ static const struct pwr_ctrl_cfg vdd_pwr_ctrl_cfg = {
	.pin = VDD_PWR_CTRL_GPIO_PIN,
};

DEVICE_INIT(vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL, &vdd_pwr_ctrl_cfg,
	    POST_KERNEL, CONFIG_BOARD_VDD_PWR_CTRL_INIT_PRIORITY);
DEVICE_DEFINE(vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL, NULL,
	      &vdd_pwr_ctrl_cfg,
	      POST_KERNEL, CONFIG_BOARD_VDD_PWR_CTRL_INIT_PRIORITY,
	      NULL);

#ifdef CONFIG_SENSOR

@@ -70,8 +72,8 @@ static const struct pwr_ctrl_cfg ccs_vdd_pwr_ctrl_cfg = {
	.pin = CCS_VDD_PWR_CTRL_GPIO_PIN,
};

DEVICE_INIT(ccs_vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL,
DEVICE_DEFINE(ccs_vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL, NULL,
	      &ccs_vdd_pwr_ctrl_cfg, POST_KERNEL,
	    CONFIG_BOARD_CCS_VDD_PWR_CTRL_INIT_PRIORITY);
	      CONFIG_BOARD_CCS_VDD_PWR_CTRL_INIT_PRIORITY, NULL);

#endif
+1 −1
Original line number Diff line number Diff line
@@ -649,6 +649,6 @@ static int gpio_stm32_afio_init(const struct device *device)
	return 0;
}

DEVICE_INIT(gpio_stm32_afio, "", gpio_stm32_afio_init, NULL, NULL, PRE_KERNEL_2, 0);
SYS_DEVICE_DEFINE("gpio_stm32_afio", gpio_stm32_afio_init, NULL, PRE_KERNEL_2, 0);

#endif /* CONFIG_SOC_SERIES_STM32F1X */
+4 −3
Original line number Diff line number Diff line
@@ -402,9 +402,10 @@ static int stm32_exti_init(const struct device *dev)
}

static struct stm32_exti_data exti_data;
DEVICE_INIT(exti_stm32, STM32_EXTI_NAME, stm32_exti_init,
	    &exti_data, NULL,
	    PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
DEVICE_DEFINE(exti_stm32, STM32_EXTI_NAME, stm32_exti_init,
	      NULL, &exti_data, NULL,
	      PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
	      NULL);

/**
 * @brief set & unset for the interrupt callbacks
+4 −3
Original line number Diff line number Diff line
@@ -413,6 +413,7 @@ static int sam0_eic_init(const struct device *dev)
}

static struct sam0_eic_data eic_data;
DEVICE_INIT(sam0_eic, DT_INST_LABEL(0), sam0_eic_init,
	    &eic_data, NULL,
	    PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
DEVICE_DEFINE(sam0_eic, DT_INST_LABEL(0), sam0_eic_init,
	      NULL, &eic_data, NULL,
	      PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
	      NULL);
+2 −2
Original line number Diff line number Diff line
@@ -789,5 +789,5 @@ static int gsm_init(const struct device *device)
	return 0;
}

DEVICE_INIT(gsm_ppp, GSM_MODEM_DEVICE_NAME, gsm_init, &gsm, NULL, POST_KERNEL,
	    CONFIG_MODEM_GSM_INIT_PRIORITY);
DEVICE_DEFINE(gsm_ppp, GSM_MODEM_DEVICE_NAME, gsm_init, &gsm, NULL, NULL,
	      POST_KERNEL, CONFIG_MODEM_GSM_INIT_PRIORITY, NULL);
Loading